Flutter Dart RenderBox was not laid out [Solved]

Often times when working with flutter layouts ListBuilder, You may come accross this  RenderBox was not laid out. The full error shown below

Another exception was thrown: RenderBox was not laid out: RenderRepaintBoundary#d169d
relayoutBoundary=up5 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE

Another exception was thrown: RenderBox was not laid out: RenderCustomPaint#8adfc
relayoutBoundary=up4 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE

Here is the solution be low

return Container(
                        paddingconst EdgeInsets.only(top10),
                        childListView.builder(
                          shrinkWraptrue,
                          itemCount: allUsers.length,
                          itemBuilder: (BuildContext context, int index) {
                            return Text('this is text');
                          },
                        ));


If you notice in the above code, there is a line containing a shrinkWrap: true. Another way to solve this is to wrap your list builder with Expanded() Widget


Column(
children: <Widget>[
Expanded(
child: ListView(...),
)
],
)