Skip to content
pubscout

flutter_context_menu

0.4.2, released 9 months ago by an unverified publisher

Create and display customizable context menus with hierarchical submenus in Flutter apps.

WASM-ready
$ flutter pub add flutter_context_menu
Source repository

What it does

Provides a flexible context menu system for Flutter supporting custom entries, submenus, keyboard shortcuts, and multiple platforms. Menus can be displayed programmatically or via a ContextMenuRegion responding to right-clicks and long-presses.

AI-written summary of version 0.4.2, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need custom context menus or right-click menus in your cross-platform application.
  • You want hierarchical submenus with selection handling and keyboard shortcuts.

Skip it when

  • You only need standard platform-native context menus without custom Flutter widget hierarchies.

Strengths

  • Supports nested submenus, menu headers, and dividers.
  • Cross-platform compatibility across Android, iOS, Web, Windows, macOS, and Linux.
  • Strong typing generics upgrade for context menu entries and values.

Weaknesses

  • Documentation for full customization is limited beyond basic examples.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0
final entries = <ContextMenuEntry>[
  const MenuHeader(text: "Context Menu"),
  MenuItem(
    label: const Text('Copy'),
    icon: const Icon(Icons.copy),
    onSelected: (value) {},
  ),
];
final menu = ContextMenu(entries: entries, position: const Offset(300, 300));
menu.show(context);

Alternatives

Packages that do the same job and could replace flutter_context_menu.

  • menu_bar

    A customizable application menu bar widget with submenus for Flutter desktop apps.

  • dropdown_button2

    Customizable Flutter dropdown button with advanced styling and multi-select support

  • re_editor

    A lightweight text and code editor widget for Flutter with syntax highlighting and folding.

  • super_text_layout

    Configurable and extensible text display for custom decorations in Flutter.

Works with

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