context_menus
2.0.0+1, released 2 years ago by gskinner.com
Shows customizable context menus on right‑click or long‑press.
What it does
Provides a ContextMenuOverlay and ContextMenuRegion widgets to display menus when the user right‑clicks or long‑presses. Menus can be built from supplied templates or fully custom widgets and styled via button and card builders.
AI-written summary of version 2.0.0+1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need a lightweight, cross‑platform context‑menu solution for desktop/web/mobile
- You want to customise menu appearance and behaviour without writing your own overlay logic
Skip it when
- You already use a full UI kit that includes its own menu system
- You require advanced animations or platform‑native menu integrations
Strengths
- Works on Android, iOS, web, Windows, macOS and Linux
- Highly customizable styling via buttonStyle, cardBuilder and buttonBuilder
- Simple API with ready‑made Link, Text and Generic menus
Weaknesses
- Limited to Flutter widgets; no native OS menu look‑and‑feel
- No built‑in animation options for menu transitions
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
ContextMenuOverlay(
child: MaterialApp(
home: Scaffold(
body: ContextMenuRegion(
contextMenu: LinkContextMenu(url: 'https://flutter.dev'),
child: const Text('https://flutter.dev'),
),
),
),
);Alternatives
Packages that do the same job and could replace context_menus.
- super_context_menu
Context menu widget supporting native menus on platforms and drag & drop transitions on mobile.
76Compare - focused_menu
Adds a long‑press context menu to any widget.
50Compare - cupertino_context_menu_plus
Enhanced CupertinoContextMenu with custom top/bottom widgets, programmatic control, and styling options.
69Compare - focused_menu_custom
Add a focused long-press or tap menu to any Flutter widget.
46Compare
Works with
Packages commonly used together with context_menus: ones it builds on, ones built on it, and its own family.