简体   繁体   中英

Layout Error While Using ListView Widget in Flutter

Hello I am trying to show some data to user with ListView but I get exactly this error:

*RenderFlex children have non-zero flex but incoming height constraints are unbounded.

My Code is Exactly Like Below,

Expanded(child:     
ListView(children:tWidgets),),]);

My Code works fine without ListView like this

return Column(children: tWidgets,);

Expanded Widgets only work inside Row and Column widgets, they cannot be used outside of these two widgets, so your solution will be like this


return Column(children: [
       Expanded( child: ListView(children: tWidgets,),)
  ],
);

I solved this issue by fixing the order of my interface. ListView was inside a Column and that column was also inside another column. I simply deleted a column. if you are facing with this problem check the hierarchy of your interface.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM