Error: RenderBox was not laid out, Failed assertion: line 1940 pos 12: ‘hasSize’

This happens when ListView has no constrained height which makes it gets an infinite height, you can solve this using two solutions

  1. add shrinkWrap: true as a parameter
    which will tell the ListView to use a little space as possible,

  2. Wrap your ListView with a constrained height widget, such as a SizedBox or a Container, and give it a height and width like so

       Container(
            height: 50,
            width: 50,
            child: ListView()
              )

hope this solves your problem

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)