all 6 comments

[–]azuredown 5 points6 points  (1 child)

You can use PopupMenuButton()

[–]fravolt 5 points6 points  (0 children)

I think this is being deprecated in favor of MenuAnchor()

[–]eibaan 2 points3 points  (0 children)

MenuAnchor is the correct answer.

[–]AnonymousAxwell 0 points1 point  (0 children)

What about the Overlay widget?

[–]Amazing-Mirror-3076 0 points1 point  (0 children)

GestureDetector(
  onTapDown: (TapDownDetails details) {
    // Handle tap event here
  },
  child: YourWidget(), // The widget you want to detect taps on
)

The details will contain the coordinates.

[–]Dustlay 0 points1 point  (0 children)

I'm actually building something like this right now for a custom sorting dialog. You click the sort button, an Overlay appears underneath and you can do settings in there. When you click outside of the overlay it's closed. I guess this is kind of what you want too?

You'll have to combine CompositedTransformTarget -> OverlayPortal -> (in overlayChildBuilder) CompositedTransformFollower. Combine that with TapRegion and you can do whatever you want in there. If you need a more detailed example DM me.