overlayBuilder property

RawMenuAnchorOverlayBuilder overlayBuilder
final

The overlayBuilder function is passed a RawMenuOverlayInfo object that defines the anchor's Rect, the Size of the overlay, the TapRegion.groupId for the menu system, and the position Offset passed to MenuController.open.

To ensure taps are properly consumed, the RawMenuOverlayInfo.tapRegionGroupId should be passed to a TapRegion widget that wraps the menu panel.

TapRegion(
  groupId: info.tapRegionGroupId,
  onTapOutside: (PointerDownEvent event) {
    MenuController.maybeOf(context)?.close();
  },
  child: Column(children: menuItems),
)

Implementation

final RawMenuAnchorOverlayBuilder overlayBuilder;