ibnufth / wrap_and_more

A Flutter Wrap widget that builds a special wrap, limiting the number of rows and the count of the remaining children.
MIT License
0 stars 4 forks source link

Widget doesn't recalculate rows et al upon resizing #2

Open aMarkSide opened 8 months ago

aMarkSide commented 8 months ago

If you remove the "width" parameter from your WrapAndMore widget in the example, it properly takes up all available width on the screen, wrapping into 3 rows. If you then resize the widget (e.g. on desktop, resizing the window), the items re-wrap automatically . . . but they don't recalculate how many items need to be displayed for the specified maxRows. So if you make the window smaller (horizontally), you will end up with three rows or more; if you make it larger, the final row will be too short (or not visible at all). Make a change to your main.dart file and save/hot-reload, and it will rebuild and properly lay itself out again . . . until you resize the window again.