Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter - Bottom Overflowed By 119 Pixels

Tags:

flutter

dart

I had an error "Bottom Overflowed by 199 pixel" when creating an Image inside the ListView, and after i google it, all of them suggest me to add:

resizeToAvoidBottomPadding: false 

But, it doesnt work! The error is still there.

enter image description here

SafeArea widget is also doesnt solve the problem. Here is the short code version of my layout:

body: ListView(          children:<Widget> [            new Container(              child: new Stack(                children:<Widget> [                  //THE WIDGET                  new Container(), //THE BACKGROND IMAGE                  new Positioned(                    child: Column(                      children:<Widget>[                          new Transform(),                          new FadeTransition(),                          new FadeTransition(),                          Divider(),                          new Row(),                          //THE IMAGE THAT I WANT TO ADD                          new Container(                            height: 360.0                            decoration: BoxDecoration(                             image: DecorationImage(                                image: Assetimage('lake.jpg)                          
like image 605
Haikal Permana Avatar asked Jan 12 '19 02:01

Haikal Permana


People also ask

How do you fix overflow pixels in flutter?

The solution to resolve this overflow error is to make your entire widget or in our case the Column scrollable. We can do that by wrapping our Column inside a SingleChildScrollView. Also, wrap the SingleChildScrollView with Center so that the entire UI is centered.

What is Stack widget in flutter?

The stack is a widget in Flutter. It contains a list of widgets and places them on top of each other. And it places their children on top of each other like a stack of books. In other words, stack developers would overlap multiple widgets on one screen. As you can add different images or colors using containers in it.


1 Answers

Use Scaffold property "resizeToAvoidBottomPadding: false" and "SingleChildScrollView" as parent of Scaffold body:

    home: Scaffold(           resizeToAvoidBottomInset : false,           appBar: AppBar(             title: Text("Registration Page"),           ),           body: SingleChildScrollView(             child: RegisterUserPage(),           )), 
like image 152
Dhanaji Yadav Avatar answered Oct 05 '22 04:10

Dhanaji Yadav