-1

In a column or any widget, when i am trying to use listview.builder it don't execute the code. But when i bundle listview.builder in expanded widget it successfully run. Why it runs in expanded widget not another widget?

in the 1st image Without expand and using shrinkwrap: true my output is like that, but why? In the 2nd image when I am wrapping my listview.builder in expanded widget it runs successfully, why? without expand output without expand code with expand output with expand code

1 Answers1

1

Listview.builder works in Column when you add shrinkwrap property as true. It is because listview and its parent takes different height or size, once you add shrinkwrap property it will get minimized to children height and will work fine. Without shrinkwrap it throw overflow or rendering error. And when you use it with expanded widget both parent and listview expands to the same height so it working fine with Expanded widget

Suganya
  • 419
  • 3
  • 11