Flutter ListView exception with unbounded height

Solution:

Try to add physics: NeverScrollableScrollPhysics() to inner ListView.


You need to constrain your parent widget so it knows where the bounds are.

For that scenario, wrapping in a Container alone, won’t have any effect unless you explicit constrain it (eg. by setting constrains or just giving it a explicit height).

Container(
    height: 200.0, // or whatever
    child: ListView(
  ....
  )
)

As an alternative, you can also set your inner ListView physics to NeverScrollableScrollPhysics() which will prevent any scroll from happening in the inner one and only the top scroll view will control scroll.

If all of that doesn't help, you may need to use a CustomScrollView which lets you nest multiple scroll views, basically a Sliver.