Skip to content

Instantly share code, notes, and snippets.

@aykuttasil
Last active March 9, 2022 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aykuttasil/e07a5e652deaa360bf7f4bda5421377e to your computer and use it in GitHub Desktop.
Save aykuttasil/e07a5e652deaa360bf7f4bda5421377e to your computer and use it in GitHub Desktop.
Flutter bottom sheet dialog is placed above to keyboard
To have the AddTaskScreen sit just above the keyboard, you can wrap it inside a SingleChildScrollView, which determines the padding at the bottom using a MediaQuery.
onPressed: () {
showModalBottomSheet(
context: context,
isScrollControlled: true,
builder: (context) => SingleChildScrollView(
child:Container(
padding: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
child: AddTaskScreen(),
)
)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment