focused_menu
1.0.5, released 6 years ago by retroportalstudio.com
Adds a long‑press context menu to any widget.
WASM-ready
What it does
The package provides a FocusedMenuHolder widget that wraps any child and shows a customizable menu on long press or tap. Menu items can be defined with titles, icons, and callbacks.
AI-written summary of version 1.0.5, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need a context menu for list items or grid tiles
- You want quick actions like open, share, favorite, delete
- You prefer a simple, declarative API without extra dependencies
Skip it when
- You require complex nested menus or hierarchical actions
- You need platform‑specific native context menus
- You are building a large app with many custom widgets and want to avoid adding another dependency
Strengths
- Easy to integrate with a single widget wrapper
- Highly customizable appearance and animation
- Supports both long press and tap activation
- Null‑safe and actively maintained
Weaknesses
- Limited to a flat menu structure
- No built‑in support for keyboard or accessibility shortcuts
- No support for dynamic menu items based on state changes
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
```dart
FocusedMenuHolder(
menuItems: [
FocusedMenuItem(
title: Text('Open'),
trailingIcon: Icon(Icons.open_in_new),
onPressed: () => Navigator.push(context, MaterialPageRoute(builder: (_) => ScreenTwo())),
),
FocusedMenuItem(
title: Text('Share'),
trailingIcon: Icon(Icons.share),
onPressed: () {},
),
],
child: Card(child: Image.asset('assets/image.png')),
)
```Alternatives
Packages that do the same job and could replace focused_menu.
- focused_menu_custom
Add a focused long-press or tap menu to any Flutter widget.
46Compare - app_badge_plus
Flutter plugin to set numeric badges on app icons for iOS, Android, and macOS
84Compare - flutter_in_app_pip
Provides in-app Picture-in-Picture support with customizable widget
54Compare - custom_pop_up_menu
Wrap any widget to display a customizable popup menu on tap or long press.
50Compare