flutter_context_menu
Create and display a customizable context menus in your app.
0.4.2
30K downloads/mo
#1863 most downloaded on pub.dev
salah-rashad/flutter_context_menu
What this package is like to depend on
Last release 5 months ago
26 Feb 2026
Release timing varies
gaps range from 8 days to 10 months
Most releases are documented
notes for 13 of 15 stable releases
Nothing withdrawn
no release was ever pulled
3 years old
15 releases · first in 2023
3 releases in the last 12 months
see the full history below
Release timeline
15 releases · Jun 2023 to Feb 2026Releases
latest 15-
0.4.226 Feb 2026Release notes
Open source →Fixed
- Type Erasure: Resolved generic type erasure across context menu item handling and preserved
generic type parameter in
MenuEntryWidgetstate (Fixes #50, #51)
- Type Erasure: Resolved generic type erasure across context menu item handling and preserved
generic type parameter in
-
0.4.130 Nov 2025Release notes
Open source →Fixed
- Hover Behavior: Fixed hover state management in menu items to prevent items from remaining highlighted after mouse exit (Fixes #45)
- Submenu Interaction: Disabled submenus no longer open on hover when they are disabled (Fixes #44)
Improved
- Code Organization:
- Moved
BuildContextExtensionsto dedicatedbuild_context_ext.dart - Moved
SingleActivatorExtensionstosingle_activator_ext.dart - Improved overall code modularity and maintainability
- Moved
Refactoring
- Reordered
itemsparameter inMenuItem.submenuconstructor for better code organization - Updated all relevant imports to match the new file structure
-
0.4.022 Nov 2025Release notes
Open source →Breaking Changes
MenuItem.labelchanged fromStringtoWidget.MenuItem.iconchanged fromIconData?toWidget?.MenuItem.colorrenamed toMenuItem.textColor.ContextMenuRegion.enableGesturesrenamed toenableDefaultGestures.ContextMenuRegionBuilder: theshowMenucallback changed fromvoid Function()tovoid Function(Offset position).ContextMenuItem.onSelectedchanged fromVoidCallback?toValueChanged<T?>?— the callback now receives the selected value.ContextMenuItem.itemschanged fromList<ContextMenuEntry>?toList<ContextMenuEntry<T>>?.ContextMenuStateis now generic (ContextMenuState<T>). CustomContextMenuEntrysubclasses that referenceContextMenuStatedirectly must add the type parameter.ContextMenuRegion.onItemSelectedchanged fromValueChanged<T>?toValueChanged<T?>?.
Added
- Support for keyboard shortcuts (
shortcut) and trailing widgets (trailing) inMenuItem. (closes #33) SingleActivatorExtensionsfor human-readable shortcut strings (e.g.,"Ctrl+O").onItemSelectedcallback onContextMenuRegionandshowContextMenufor immediate selection handling without awaiting the route result.kMenuItemHeightandkMenuItemIconSizeconstants for consistentMenuItemlayout.mediaQueryextension onBuildContextto simplifyMediaQueryaccess.
Changed
- Full generics upgrade:
ContextMenu<T>,ContextMenuItem<T>,ContextMenuEntry<T>, andContextMenuState<T>are now strongly typed throughout. - Updated default
spawnAnchorfor submenus to improve positioning. debugLabelnow usesdescribeIdentityfor consistent element identification, andMenuItemincludes its label in the output.- Extracted
ContextMenuWidgetViewfor cleaner separation of concerns. - Updated example project to showcase new features.
Fixed
showContextMenunow uses the root navigator by default, ensuring the menu displays above nested navigators and preventing multiple instances. (Fixes #21)
Removed
- Removed unused internal helpers:
hasSameFocusNodeId,getScreenRect, andparentMenuKey.
-
0.3.015 Aug 2025Release notes
Open source →The Flutter SDK constraint in
pubspec.yamlhas been changed from^3.27.0to>=3.27.0.Solving the issue:
-
The Flutter constraint should not have an upper bound.
In your pubspec.yaml the constraint is currently^3.27.0.You can replace that with just the lower bound:
>=3.27.0.
Release notes
Open source →Added / Changed
- feat: A
requestFocusparameter has been added toMenuRouteOptionsand is utilized in theshowMenuhelper function. - Updated
ContextMenuWidget,MenuHeader, andMenuItemto useColor.withValues(). - Minor improvements compatible with Flutter 3.27+.
Breaking Changes
- Requires Flutter 3.27+ and Dart 3.6+.
- Pubspec environment:
sdk: ^3.6.0 - Not compatible with older Flutter versions (<3.27). Use
0.2.6instead.
Notes
- This release introduces a new API and may require changes in dependent code.
-
-
0.2.615 Aug 2025Release notes
Open source →Fixed
- Replaced
Color.withValues()withcolor.withOpacity()for compatibility with Flutter 3.0–3.26. - Ensured
ContextMenuWidget,MenuHeader, andMenuItemwork on older Flutter versions.
Notes
- This release is intended for users on Flutter versions below 3.27.
- No new features introduced; only compatibility fixes.
- Pubspec environment:
sdk: '>=3.0.0 <3.6.0'
- Replaced
-
0.2.515 Aug 2025Release notes
Open source →- Refactor: Improve/Fix submenu positioning logic.
- FEAT: Handle long menus properly with scrolling and add example for long menu.
- FEAT: Allow customization of context menu max height.
-
0.2.403 Jun 2025 -
0.2.303 Jun 2025Release notes
Open source →- Fix context menu is not showing in web (closes #7).
- Add keyboard shortcuts to navigate through the context menu items using the arrow keys (closes #12).
- Fix bug when using
setPathUrlStrategy()in web (closes #17).
-
0.2.228 Mar 2025Release notes
Open source →- Update
README.md. - Update default shortcuts.
- Add generic types to base classes and widgets (closes #3).
- Updated
ContextMenuRegionfor simplified gesture handling. (closes #4) - Updated
ContextMenuRegionto be more customizable with builder. (closes #6) - Fix menu to not auto focus on first item. (closes #11).
- Fix focus bugs.
Release notes
Open source →- Update
README.md. - Update default shortcuts.
- Add generic types to base classes and widgets (closes #3).
- Updated
ContextMenuRegionfor simplified gesture handling. (closes #4) - Updated
ContextMenuRegionto be more customizable with builder. (closes #6) - Fix menu to not auto focus on first item. (closes #11).
- Fix focus bugs.
- Update
-
0.2.128 Mar 2025Release notes
Open source →- Add
maybeOfto the context menu state - Move
calculateSubmenuPositionto utils.dart - Some UI changes in the
example project
Release notes
Open source →- Add
colorvariable to the context menu item, allowing the item text and icon colors to be customized. - Add
enabledvariable to the context menu item, allowing the item to be disabled if needed. - Add
maybeOf(BuildContext)to the context menu state. - Move
calculateSubmenuPositionto the utils file (lib/src/core/utils.dart). - Some UI changes in the example project.
- Add
-
0.2.002 Jun 2024Release notes
Open source →- Removed
providerandequatabledependencies as they are no longer needed. - Updated the package's dependencies to the latest versions.
- Removed unnecessary platform specific folders.
- The package is now fully dependent on InheritedWidget for state management.
- Replaced the old
Overlaywidget with the newOverlayPortalwidget. - Globally applied focus node highlighting and keyboard shortcuts for menu items.
- Added
shortcutsproperty in theContextMenuclass for custom context menu shortcuts.
- Removed
-
0.1.309 Nov 2023Release notes
Open source →- updated example project.
- added
ContextMenuRegionwidget to show a context menu when a user right-clicks or long-presses on a widget. - improvements and fixes.
- updated
README.md.
-
0.1.204 Nov 2023Release notes
Open source →- added example project.
- added a preview gif to "README" file.
- added
DefaultContextMenuDividerin components. - added
DefaultContextMenuItemin components. - added
DefaultContextMenuTextHeaderin components. - improvements and fixes.
-
0.1.122 Jun 2023Nothing published for this version
-
0.1.022 Jun 2023Nothing published for this version