A modal bottom sheet is an alternative to a menu or a dialog and prevents the user from interacting with the rest of the app.
If you are looking out for an example on, How to send data to Modal bottom sheet in Flutter, check this article. [https://fluttercentral.com/Articles/Post/1110font-size: 1rem;](https://fluttercentral.com/Articles/Post/1110)
Before going further, lets get some basics on bottom sheets.
There are two kinds of bottom sheets in material design: Persistent and Modal.
In this example, we are going to see Modal type.
If you want to check out about persistent, check this article here. [https://fluttercentral.com/Articles/Post/1149font-size: 1rem;](https://fluttercentral.com/Articles/Post/1149)
This is how the final output of this Modal Bottom Sheet example is going to look like.
;
}
class _ModalBottomSheetDemoState extends State {
void _showModalSheet() {
showModalBottomSheet(
context: context,
builder: (builder) {
return Container(
child: Text('Hello From Modal Bottom Sheet'),
padding: EdgeInsets.all(40.0),
);
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Modal bottom sheet')),
body: Center(
child: RaisedButton(
onPressed: _showModalSheet,
child: const Text('Show Modal Bottom Sheet'))));
}
}
Please let me know if you have any further queries.
Thanks,
Srikanth