RenderBox was not laid out: RenderViewport#680c1 NEEDS-LAYOUT NEEDS-PAINT
When using listview.builder() layout, this error may be reported if it is nested in row or column. The reason is that the size is not specified for the listview, so a sizedbox or container should be set outside the listview, and then a height should be specified. Or if you want to adapt the height, set a flexible or expanded.
return Scaffold(
body: SafeArea(
left: false,
right: false,
child: Container(
padding: EdgeInsets.fromLTRB(0, 12, 0, 36),
child: Column(children: [
......
other components
......
Expanded(
child: Container(
child: ListView(
children: []
..add(row('Anywhere'))
..add(or())
..add(row('Country'))
..add(row('State'))),
)),
......
other components
......
]))));
If the screen is still blank, try setting shrinkwrap to true and physics to neverscrollablescrollphysics()
Similar Posts:
- PHP FPM: a project website frequently appears 503 problem solving (warning: [pool www] server reached pm.max)_ children setting (50), consi…
- Android Your content must have a ListView whose…
- A problem with 0 document. Documentelement. Clientwidth
- [Solved] echart Error: Can’t get dom width or height
- [Solved] django DRF This field may not be null, This field cannot be blank
- How to Solve the window flicker problem caused by AWT components
- Warning: Input is changing an uncontrolled input of type text to be controlled…
- SQL Error: 1064, SQLState: 42000 [Three Methods to Solve]
- Bootstrap switch Uncaught TypeError: Cannot read property ‘apply’ of undefined