I have some widgets inside of a Stack
.
When the keyboard appears, the widgets in the Stack
that were explicitly Positioned at the bottom using Positioned(bottom: 0)
widget, get shifted to the top of keyboard.
How can I prevent this, and make some widgets retain their position, whether or not the keyboard is in the view?
For example, I want the "Offline Mode" label to be under the keyboard, not over it.
Here is a rough sketch of what this page's widgets look like:
Scaffold(
body: Stack(
children: [
LoginImage(),
LoginForm(),
ConnectedToInternet(),
],
),
)
Here is what the ConnectedToInternet
widget looks like-
Positioned(
bottom: 0,
child: Container(
width: MediaQuery.of(context).size.width,
color: Colors.grey[900],
child: Padding(
padding: const EdgeInsets.all(4.0),
child: Center(
child: Text(
"Offline mode",
style: TextStyle(color: Colors.white, fontSize: 12),
),
),
),
),
);