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.
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)
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.
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.
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(), )),
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With