flutter_show_menu library

A flexible overlay-based menu for Flutter.

Use showOverlayMenu to display a menu anchored to any widget, or wrap a widget with OverlayMenuButton for a tap-to-open shortcut.

Features:

  • Anchor to any side of the target (MenuPosition) with cross-axis alignment (MenuAlignment).
  • Fixed header/footer entries outside the scroll area.
  • Selected-item auto-scroll, dividers, scrollbar customisation and animated mouse wheel scrolling (WheelMotion) via OverlayMenuStyle.
  • Automatic dismissal on route changes and programmatic close via OverlayMenuController.
  • App-wide dismissal of every open menu at once via closeAllOverlayMenus for non-route moments (session expiry, app backgrounding, etc.).

Classes

OverlayMenuBarrier
The full-screen area behind the menu, and how it behaves.
OverlayMenuButton<T>
Wraps a child widget and shows an overlay menu when it is tapped.
OverlayMenuController
Controller to programmatically close an open overlay menu.
OverlayMenuDivider<T>
A horizontal divider line inside an overlay menu.
OverlayMenuDividerStyle
Style for menu dividers.
OverlayMenuEntry<T>
Base type for entries in an overlay menu.
OverlayMenuItem<T>
Defines an individual item in the overlay menu.
OverlayMenuItemStyle
Default style for individual menu items.
OverlayMenuMotion
How the menu animates in and out.
OverlayMenuPlacement
Where the menu sits relative to the widget it is anchored to.
OverlayMenuScrollbarStyle
Style for the menu scrollbar.
OverlayMenuStyle
How the menu surface looks and how large it is allowed to be.
WheelMotion
How a SmoothScrollController moves to its wheel target.

Enums

Determines the cross-axis alignment of the menu.
Determines which side of the target widget the menu will appear on.

Functions

closeAllOverlayMenus() → void
Closes every open overlay menu immediately, app-wide.
showOverlayMenu<T>({required BuildContext context, required List<OverlayMenuEntry<T>> items, List<OverlayMenuEntry<T>>? header, List<OverlayMenuEntry<T>>? footer, T? initialValue, OverlayMenuPlacement placement = const OverlayMenuPlacement(), OverlayMenuBarrier barrier = const OverlayMenuBarrier(), OverlayMenuMotion motion = const OverlayMenuMotion(), OverlayMenuStyle? style, OverlayMenuController? controller}) → Future<T?>
Displays an OverlayEntry-based menu as a replacement for showMenu.

Typedefs

OverlayMenuFooterStyle = OverlayMenuItemStyle
Style for footer items. Same shape as OverlayMenuItemStyle.
OverlayMenuHeaderStyle = OverlayMenuItemStyle
Style for header items. Same shape as OverlayMenuItemStyle.