Is it possible to push all content up when open keyboard? (not only textField area, whole page push up)
showModalBottomSheet(
context: context,
builder: (BuildContext context) {
return BottomSheet();
},
isScrollControlled: true);
BottomSheet class
class BottomSheet extends StatefulWidget {
@override
_BottomSheetState createState() => _BottomSheetState();
}
class _BottomSheetState extends State<BottomSheet> {
@override
Widget build(BuildContext context) {
return
SingleChildScrollView(
padding: EdgeInsets.only(
bottom: MediaQuery.of(context).viewInsets.bottom),
child: Container(
child: Column(
children: <Widget>[...
I want to like this push-up,
But Current output is,
Simply putting reverse=true
inside the SingleChildScrollView
will suffice.
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: SingleChildScrollView(
reverse: true,
child: Container(
........
........
You can simply give the widget a bottom
position of MediaQuery.of(context).viewInsets.bottom
if you are using a stack.
In your case, set margin :
to MediaQuery.of(context).viewInsets.bottom
instead of padding.
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