close
Exceptions caused by rendering / A RenderFlex overflowed, renderflex overflowed by 28 pixels, exceptions caused by rendering, dart exceptions caused by rendering, flutter dart exceptions caused

[solved] Flutter (Dart): Exceptions caused by rendering / A RenderFlex overflowed

Hello Guys, how are you all? Hope you all are fine. You might face Flutter (Dart): Exceptions caused by rendering / A RenderFlex overflowed as this error in a flutter. 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 Flutter (Dart): Exceptions caused by rendering / A RenderFlex overflowed Error Occurs ?

How can I manage or apply scrolling ability to my app page view and avoid Flutter’s rendering exceptions with messages like:

A RenderFlex overflowed by 28 pixels on the bottom.

How to resolve my scrolling issue and RenderFlex overflowed by 28 pixels on the bottom. In my app.

How to solve Flutter: Exceptions Caused by rendering Or RenderFlex overflowed Error ?

I’d recommend either wrapping your entire content in a SingleChildScrollView, or using a scrolling ListView.

  1. How to solve Flutter: Exceptions Caused by rendering Or RenderFlex overflowed Error?

    to solve Flutter: Exceptions Caused by rendering Or RenderFlex overflowed Error To resolve this error I'd recommend either wrapping your entire content in SingleChildScrollView Or use ListView. both widgets will solve your bottom overflowed exceptions.

  2. Flutter: Exceptions Caused by rendering Or RenderFlex overflowed

    to solve Flutter: Exceptions Caused by rendering Or RenderFlex overflowed Error To resolve this error I'd recommend either wrapping your entire content in SingleChildScrollView Or use ListView. both widgets will solve your bottom overflowed exceptions.

Solution 1: Use SingleChildScrollView

To resolve this error I’d recommend either wrapping your entire content in SingleChildScrollView Or use ListView. both widgets will solve your bottom overflowed exceptions.

The Flutter SDK team puts a lot of effort into good documentation within the SDK code itself. One of the best resources for understanding the algorithm that Flex widgets (Row and Column are both subclasses of Flex) use to lay out their children is the DartDoc that accompanies the class itself:

Also Use This Tutorial By Flutter Official.

Solution 2: Column wrapped in SingleChildScrollView

SingleChildScrollView(
  child: Column(children: children),
)

Solution 3:ListView

ListView(
  children: children
)

Solution 4: Column and ListView Both

combination of both Column and ListView(you should use Expanded/Flexible, or give a fixed height to the ListView when doing so).

Column(
  children: [
    ...children.take(2).toList(), // show first 2 children in Column
    Expanded(
      child: ListView(
        children: children.getRange(3, children.length).toList(),
      ), // And rest of them in ListView
    ),
  ],
)

Solution 5: Use Flexible or Expanded

try to wrap of Container or any of other Widget in Flexible or Expanded and it Will be done.

Do like this

           Flexible(
              child: Container(
                padding: EdgeInsets.all(5),
                height: 400,
                width: double.infinity,
                child: ListView.builder(
                  scrollDirection: Axis.vertical,
                  shrinkWrap: true,
                  itemCount: 4,
                  itemBuilder: (context, index) {
                    return ListTile(
                      title: Text("Tony Stark"),
                      subtitle: Text("A Iron Man"),
                    );
                  },
                ),
              ),
            )

Solution 6: Use PreferredSize 

                PreferredSize(
                    preferredSize: Size.fromHeight(120.0),
                    child: //Your Child
                )

Summery

So it’s all About All possible solutions. Hope this above all solution helped you a lot. Comment below Your thoughts and your queries. Comment Below on your suggestion.

Check Out Below Article


Posted

in

,

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *