Search code examples
flutterflutter-animation

Page popup from bottom flutter


I have an app and i wanted to add page thad slides from the bottom up, ultill three quarters of the screen, just as shown in the picture hereenter image description here

and if you press the arrow it will go back again.

enter image description here

As you can see, once you press the food system, that threee quarter page will pop up. I have the onclock and everython ready but i just dont know what to use once you press it.


Solution

  • You can use 'showModalBottomSheet' widget. more info

    showModalBottomSheet(
         context: context,
         builder: (builder) {
              return childWidget;
         },
    

    and for 3/4 of screen height, you can set something like this:

    double mWidth = MediaQuery.of(context).size.width;
    double mHeight = MediaQuery.of(context).size.height;
    
    Widget childWidget(){
         return Container {
            width: mWidth,
            height: mHeight  * 0.75,
         }
    }