I would like to add a screen that slowly appears form the bottom or the screen and partially covers the main screen below. So you can still see the top part of the main screen. Does anyone know how to do this?
Thank you very much
showModalBottomSheet<void>(
// context and builder are
// required properties in this widget
context: context,
builder: (BuildContext context) {
// we set up a container inside which
// we create center column and display text
// Returning SizedBox instead of a Container
return SizedBox(
height: MediaQuery.of(context).size.height * 0.6,
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[
Text('HERE You'll add all your content'),
],
),
),
);
},
);
You can call above method in
initState() of screen or buttons onPressed or onTap.
3
Answers
for this you can use showModalBottomSheet method the simple example is
you can read more about this method here
You can use showModalBottomSheet() same as below…
You can call above method in
initState() of screen or buttons onPressed or onTap.
As per your shared Image I have try something like that Using
ModalBottomSheet
Your Button Widget
bottomSheet Widget:
Result Screen->