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.

  1. Wrap ListView in Expanded

    Column(
      children: <Widget>[
        Expanded( // wrap in Expanded
          child: ListView(...),
        ),
      ],
    )
    
  2. Wrap ListView in SizedBox and give a bounded height

    Column(
      children: <Widget>[
        SizedBox(
          height: 400, // fixed height
          child: ListView(...),
        ),
      ],
    )
    
  3. Use shrinkWrap: true in ListView.

    Column(
      children: <Widget>[
        ListView(
          shrinkWrap: true, // use this
        ),
      ],
    )
    

Adding this two lines

ListView.builder(
    scrollDirection: Axis.vertical,
    shrinkWrap: true,
...