Closed riverscuomo closed 11 months ago
Glad you resolved the issue!
Wrapping a Column in a ListView widget changed the layout rules.
In the Flutter Widget tree, parent widgets dictate the rules for their children. By default, a Column widget will take all the available vertical space, and it positions its children based on the mainAxisAlignment and crossAxisAlignment properties. If these properties are not specified, the children end up being positioned at the start of the column (top for mainAxisAlignment and left for crossAxisAlignment).
But once you wrap the Column with a ListView, its constraints change. A ListView widget does not enforce its children to take up all the available space. Instead, it makes its children to occupy only what they need, allowing the rest of the widgets to move up, effectively reducing or removing the space. Furthermore, ListView itself is scrollable, adding a functionality that didn't exist in Column.
But be cautious with ListView, especially when nesting ListView inside another ListView, or inside any scrollable widget, as it may cause confusion with gesture detection leading to undesired scrolling behavior. Always test your UI thoroughly to make sure it's working as you expect.
had to wrap in column in listview!!??
also, moving away from slivers, but that's besides the point.