Issue
I would like to have a background image with text inputs but I don't know which widget I should use to avoid the background image to shrink when my keyboard is active.
Here you can find two screen shots of the problem and my code:
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
var backgroundImage = new BoxDecoration(
image: new DecorationImage(
image: new AssetImage('assets/forest.jpg'), fit: BoxFit.cover));
return new MaterialApp(
home: new Scaffold(
body: new Stack(
children: <Widget>[
new Container(
decoration: backgroundImage,
),
new TextField()
],
)));
}
}
closed keyboard active keyboard
Solution
You can use the property resizeToAvoidBottomPadding
from Scaffold
:
Scaffold(
resizeToAvoidBottomPadding: false,
...
Answered By - diegoveloper
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.