skip to Main Content

I am trying to create a functionality to open a page as a popup instead of navigating to it. Something similar to the screenshot below. I can’t seem to find it anywhere in the documentation on how to achieve this. I have tried Navigator.push(), but it doesn’t have options to achieve what I’m looking for

enter image description here

Any ideas?

2

Answers


  1. You can use showModalBottomSheet.
    Here’s the documentation.

    Login or Signup to reply.
  2. You can use this BottomSheet or Dialog to get popup the second page.

    showModalBottomSheet(
            context: context,
            builder: (context) {
              return StatefulBuilder(
                  builder: (BuildContext context, StateSetter setState) {
                return SecondPage();
              });
        });
    

    or

    showDialog(
        context: context,
        builder: (context) {
          return StatefulBuilder(
              builder: (BuildContext context, StateSetter setState) {
            return SecondPage();
          });
    });
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search