popup_menu
2.1.0, released 2 years ago by an unverified publisher
A pure Dart popup menu widget for iOS and Android.
What it does
PopupMenu provides a customizable context menu that can be shown at a specific rect or widget key. It supports custom icons, text styles, and callbacks for clicks, show, and dismiss events.
AI-written summary of version 2.1.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need a lightweight, platform‑agnostic popup menu without external dependencies.
- You want to customize the menu items’ appearance and behavior directly in code.
Skip it when
- You require advanced animations or gesture handling beyond basic show/hide.
- You need a fully featured menu system with built‑in actions like navigation or state management.
Strengths
- Pure Dart implementation, no native code or platform channels.
- Easy to integrate: just set PopupMenu.context and call show().
- Highly customizable: background, line color, max columns, item icons, text styles.
Weaknesses
- No built‑in animation support; show/hide is instant.
- Limited feature set; no nested menus or complex interactions.
- Last major update was in 2022; may lack recent Flutter improvements.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
Set PopupMenu.context = context; then create and show the menu.
PopupMenu menu = PopupMenu(
items: [
MenuItem(title: 'Copy', image: Image.asset('assets/copy.png')),
MenuItem(title: 'Home', image: Icon(Icons.home)),
],
onClickMenu: (index) => print('clicked $index'),
);
menu.show(rect: rect);Alternatives
Packages that do the same job and could replace popup_menu.
- popup_menu_plus
A Flutter Popup Menu Widget written completely in Dart supporting both iOS and Android.
56Compare - arrow_popup
A popup bubble with a pointing arrow for tooltips, popovers, menus and dropdowns.
73Compare - star_menu
Contextual popup menus with different shapes, animations, and custom widget entries.
70Compare - unified_popups
Unified overlay popup system for Flutter offering toast, loading, confirm, sheet, menu and more without needing a BuildContext.
63Compare