Skip to content

Instantly share code, notes, and snippets.

@indraAsLesmana
Created April 26, 2022 01:15
Show Gist options
  • Save indraAsLesmana/4ddccea30944d7989a9b05b3f94258bb to your computer and use it in GitHub Desktop.
Save indraAsLesmana/4ddccea30944d7989a9b05b3f94258bb to your computer and use it in GitHub Desktop.
ModalBottomSheet above Keyboard
showModalBottomSheet(
context: context,
isScrollControlled: true,
builder: (context) => SingleChildScrollView(
child: Container(
color: Color(0xff757575),
padding: EdgeInsets.only(
bottom: MediaQuery.of(context).viewInsets.bottom),
child: Container(
padding: EdgeInsets.all(20.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
@indraAsLesmana
Copy link
Author

Positioning the BottomSheet above the Keyboard issue on Android.

  1. add isScrollControlled: true to bottomSheet property
  2. wrap content withSingleChildScrollView and add padding: EdgeInsets.only( bottom: MediaQuery.of(context).viewInsets.bottom)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment