Vertical viewport was given unbounded height
This generally happens when you try to use a ListView
/GridView
inside a Column
, there are many ways of solving it, I am listing few here.
Wrap
ListView
inExpanded
Column( children: <Widget>[ Expanded( // wrap in Expanded child: ListView(...), ), ], )
Wrap
ListView
inSizedBox
and give a boundedheight
Column( children: <Widget>[ SizedBox( height: 400, // fixed height child: ListView(...), ), ], )
Use
shrinkWrap: true
inListView
.Column( children: <Widget>[ ListView( shrinkWrap: true, // use this ), ], )
Adding this two lines
ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
...