close

[Solved] RenderFlex children have non-zero flex but incoming height constraints are unbounded

Hello Guys How are you all? Hope You all are fine. When I was trying to run my flutter app and suddenly I get the following error in my stack track. RenderFlex children have non-zero flex but incoming height constraints are unbounded in flutter. So today Here I come with all possible solutions for this error.

We are providing you all possible solutions to solve this error. let’s start this article without wasting your time.

How RenderFlex children have non-zero flex but incoming height constraints are unbounded Error Occurs ?

I have ListView inside another widget when I wrap FutureBuilder in a Column in order to have a simple Row. I get this error:

The following assertion was thrown during performLayout():
I/flutter (13816): RenderFlex children have non-zero flex but incoming height constraints are unbounded.
I/flutter (13816): When a column is in a parent that does not provide a finite height constraint, for example, if it is
I/flutter (13816): in a vertical scrollable, it will try to shrink-wrap its children along the vertical axis. Setting a

How to Solve RenderFlex children have non-zero flex but incoming height constraints are unbounded Error?

  1. How to Solve RenderFlex children have non-zero flex but incoming height constraints are unbounded Error?

    to solve RenderFlex children have non-zero flex but incoming height constraints are unbounded errors You just have to give specific height to the column widget. So that Wrap your Column inside an Expanded or SizedBox (with some height) like the below code.

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

    to solve RenderFlex children have non-zero flex but incoming height constraints are unbounded errors You just have to give specific height to the column widget. So that Wrap your Column inside an Expanded or SizedBox (with some height) like the below code.

Solution 1

You just have to give specific height to the column widget. So that Wrap your Column inside an Expanded or SizedBox (with some height) like this:

Expanded(
  child: Column(...)
)

or you can use SizedBox (with some height) like this:

SizedBox(
  height: 250,
  child: Column(...),
)

Solution 2

You can Try to wrap of Column or any of other Widget in Expanded or Flexible and it Will be done. And Don’t forget to give some height to the Scrolling widgets. The fix for this above issue is to Wrap the widget inside a Expanded widget. Example below.

 Expanded(
   child: Column(
     children: <Widget>[
        Container(
           height: 400,
           width: 400,
           child: ListView.builder(
              itemCount: 2,
              itemBuilder: (context, position) {
                // Youyr Code
                },
             ),
          ),
       ],
    ),
 )

Summery

So, It’s All About This Error. I hope this tutorial helps you to Solve your error. Please Comment Below if You stucks anywhere with my code. And please comment below on which solution worked for you. Thank You.

Also Check Out Below Tutorials

Leave a Comment

%d bloggers like this: