Skip to content
pubscout

focused_menu

1.0.5, released 6 years ago by retroportalstudio.com

Adds a long‑press context menu to any widget.

WASM-ready
$ flutter pub add focused_menu
Source repository

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.