Skip to content
pubscout

context_menus

2.0.0+1, released 2 years ago by gskinner.com

Shows customizable context menus on right‑click or long‑press.

WASM-ready
$ flutter pub add context_menus
Source repository

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.

Works with

Packages commonly used together with context_menus: ones it builds on, ones built on it, and its own family.