By default, the BottomSheet will take up half the screen:
onPressed: () {
showModalBottomSheet(
context: context,
builder: (context) => AddTaskScreen(),
);
}
For certain screen sizes, this may mean the Add button is obscured. Setting the isScrolledControlled property to true you can make the modal take up the full screen:
onPressed: () {
showModalBottomSheet(
context: context,
isScrollControlled: true,
builder: (context) => AddTaskScreen(),
);
}
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(),
)
)
);
}