Column
expands to the maximum size in main axis direction (vertical axis), and so does the ListView
.
Solutions
So, you need to constrain the height of the ListView
. There are many ways of doing it, you can choose that best suits your need.
-
If you want to allow
ListView
to take up all remaining space insideColumn
useExpanded
.Column( children: <Widget>[ Expanded( child: ListView(...), ) ], )
-
If you want to limit your
ListView
to certainheight
, you can useSizedBox
.Column( children: <Widget>[ SizedBox( height: 200, // constrain height child: ListView(), ) ], )
-
If your
ListView
is small, you may tryshrinkWrap
property on it.Column( children: <Widget>[ ListView( shrinkWrap: true, // use it ) ], )