Answers for "another exception was thrown: renderbox was not laid"

4

Another exception was thrown: RenderBox was not laid out: RenderFlex#2f914 relayoutBoundary=up4

You're trying to use ListView.builder in a FutureBuilder which has no sizes in a Column, so you need to constrain it somehow – either with SizedBox(height: 300, child: ListView.builder()) or with Expanded widget

Check out this article https://flutter.dev/docs/development/ui/layout/constraints
Posted by: Guest on August-07-2021
0

RenderBox was not laid out:

new Row(
      children: <Widget>[
        Expanded(
          child: SizedBox(
            height: 200.0,
            child: new ListView.builder(
              scrollDirection: Axis.horizontal,
              itemCount: products.length,
              itemBuilder: (BuildContext ctxt, int index) {
                return new Text(products[index]);
              },
            ),
          ),
        ),
        new IconButton(
          icon: Icon(Icons.remove_circle),
          onPressed: () {},
        ),
      ],
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
    )
Posted by: Guest on June-26-2021

Code answers related to "another exception was thrown: renderbox was not laid"

Browse Popular Code Answers by Language