Home > Software engineering >  Flutter | Display Container above all widgets / Floating Modal Bottom sheet
Flutter | Display Container above all widgets / Floating Modal Bottom sheet

Time:10-07

What is the best way to implement a widget, floating above all? Behaving like a Modal Bottom sheet, but not stuck to the bottom. That closes when clicked outside?

I could implement it myself with a stack and a complex widget tree, but that dose not seem to be the Strong Flutter way?

I thought about using showDialog, but is it the best option?

example page View

CodePudding user response:

here is a package using that you can create a container that floats above the other widgets.

Click to see demo example

CodePudding user response:

Yes, showDialog is the best option

    showDialog(
      context: context,
      builder: (context) => YourAboveWidget(),
    ).then((value) {
      //Return value from Navigator.pop(context, value)
    });
  • Related