Home > Enterprise >  LIstView.builder in flutter
LIstView.builder in flutter

Time:12-10

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?

CodePudding user response:

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

  • Related