DEV Community

Cover image for [Solved] Flutter: RenderBox was not laid out - fluttercorner.com
FlutterCorner
FlutterCorner

Posted on

[Solved] Flutter: RenderBox was not laid out - fluttercorner.com

Hello Guys how are you all ? Hope you all are fine. By using Flutter might be all flutter developer faced this error RenderBox was not laid out in Flutter.

I am trying to make ListView in my project file. Everything was working Fine. But when I applied Text Widget in my ListView builder. There is Some issue to use Text Widget.

What is Error

In my case, while I am using ListView inside a Column/Row. The text in the exception gives an error RenderBox was not laid out. As shown below.

Here Is My Code Where I am faced this Error

              children: <Widget>[
                  new ListView.builder(
                    itemCount: products.length,
                    itemBuilder: (BuildContext ctxt, int index) {
                      return new Text(products[index]);
                    }
                  ),
              ],
Enter fullscreen mode Exit fullscreen mode

Error That I got In stack track

I/flutter (12956): ════════════════════════════════════════════════════════════════════════════════════════════════════
I/flutter (12956): Another exception was thrown: RenderBox was not laid out: RenderViewport#925a8 NEEDS-LAYOUT NEEDS-PAINT
I/flutter (12956): Another exception was thrown: RenderBox was not laid out: RenderViewport#925a8 NEEDS-PAINT
I/flutter (12956): Another exception was thrown: RenderBox was not laid out: RenderIgnorePointer#8bbda relayoutBoundary=up11 NEEDS-PAINT
I/flutter (12956): Another exception was thrown: RenderBox was not laid out: RenderSemanticsAnnotations#209b4 relayoutBoundary=up10 NEEDS-PAINT
I/flutter (12956): Another exception was thrown: RenderBox was not laid out: RenderPointerListener#a9641 relayoutBoundary=up9 NEEDS-PAINT
I/flutter (12956): Another exception was thrown: RenderBox was not laid out: RenderSemanticsGestureHandler#9f5b4 relayoutBoundary=up8 NEEDS-PAINT
I/flutter (12956): Another exception was thrown: RenderBox was not laid out: _RenderScrollSemantics#47944 relayoutBoundary=up7 NEEDS-PAINT
I/flutter (12956): Another exception was thrown: RenderBox was not laid out: RenderRepaintBoundary#e17a8 relayoutBoundary=up6 NEEDS-PAINT
I/flutter (12956): Another exception was thrown: RenderBox was not laid out: RenderCustomPaint#a2328 relayoutBoundary=up5 NEEDS-PAINT
I/flutter (12956): Another exception was thrown: RenderBox was not laid out: RenderRepaintBoundary#02607 relayoutBoundary=up4 NEEDS-PAINT
I/flutter (12956): Another exception was thrown: RenderBox was not laid out: RenderFlex#79164 relayoutBoundary=up3 NEEDS-PAINT
I/flutter (12956): Another exception was thrown: 'package:flutter/src/rendering/shifted_box.dart': Failed assertion: line 310 pos 12: 'child.hasSize': is not true.
I/flutter (12956): Another exception was thrown: NoSuchMethodError: The method '<=' was called on null.
Enter fullscreen mode Exit fullscreen mode

Solutions

Here is All Possible Solution added please visit [Solved] Flutter: RenderBox was not laid out

Top comments (0)