How to allow popup menu to go outside application window bounds in flutter desktop?

Issue

I don’t even think this is possible but, what I’m looking for is to allow the showMenu() popup to go beyond the application window.

Currently, I’m using:

showMenu(
    context: context,
    items: <PopupMenuEntry>[
      PopupMenuItem(
        value: 1,
        child: Row(
          children: const <Widget>[
            Icon(Icons.delete),
            Text("Delete"),
          ],
        ),
      )
    ], 
    position: RelativeRect.fromLTRB(0, 0,0,0),
);

Simply changing the position field to be below the height bounds of the application window doesn’t work for me.

Edit: I do know that it is possible with a C# desktop app where a dropdown popup can go outside the bounds of the application window, so I figured flutter could do this as well.

Solution

Currently Flutter only supports a single window, so there’s no way to do this from Dart at the moment.

If it’s a critical feature for your application, you would need to build a plugin that shows a native popup. The menu’s UI would need to be native as well, unless you bring up a second Flutter engine just to draw it.

Answered By – smorgan

Answer Checked By – Timothy Miller (FlutterFixes Admin)

Leave a Reply

Your email address will not be published.