popup_menu_2 0.1.7 copy "popup_menu_2: ^0.1.7" to clipboard
popup_menu_2: ^0.1.7 copied to clipboard

A popup menu containing clickable buttons, each with a global click function referring to the item. This is designed to avoid breaking the user's attention.

popup_menu_2 logo

Lightweight and customizable Flutter popup menus designed to keep user attention on the current context.

pub package pub likes pub points platform

GitHub stars GitHub issues GitHub license GitHub last commit

Build status

🌐 Watch the demo web release  |  📦 Download the latest APK

This is a fork of popup_menu by @chinabrant #

✨ Highlights #

  • Context-aware popup positioning.
  • Supports both tap and long-press triggers.
  • Grid-style menu with configurable columns.
  • Dismiss-on-click-away behavior.
  • Works across Flutter-supported platforms.

📸 Preview #

popup preview 3 popup preview 2 popup preview 1

📦 Installation #

Add dependency to your pubspec.yaml:

dependencies:
    popup_menu_2: ^0.1.6

Then run:

flutter pub get

🚀 Quick Start #

ContextualMenu #

import 'package:flutter/material.dart';
import 'package:popup_menu_2/popup_menu_2.dart';

final GlobalKey targetKey = GlobalKey();

ContextualMenu(
    targetWidgetKey: targetKey,
    maxColumns: 2,
    dismissOnClickAway: true,
    backgroundColor: Colors.black87,
    items: [
        ContextPopupMenuItem(
            onTap: () async {},
            child: const Icon(Icons.add, color: Colors.white),
        ),
        ContextPopupMenuItem(
            onTap: () async {},
            child: const Icon(Icons.remove, color: Colors.white),
        ),
    ],
    child: Icon(Icons.more_vert, key: targetKey),
)

CustomPopupMenu + Controller #

import 'package:flutter/material.dart';
import 'package:popup_menu_2/popup_menu_2.dart';

final controller = CustomPopupMenuController();

CustomPopupMenu(
    controller: controller,
    pressType: PressType.singleClick,
    menuBuilder: () => Container(
        padding: const EdgeInsets.all(12),
        decoration: BoxDecoration(
            color: Colors.white,
            borderRadius: BorderRadius.circular(12),
        ),
        child: const Text('Hello from popup_menu_2'),
    ),
    child: const Icon(Icons.touch_app),
)

⚙️ Core Options #

  • ContextualMenu: maxColumns, dismissOnClickAway, position, backgroundColor, highlightColor, lineColor.
  • CustomPopupMenu: pressType, showArrow, arrowColor, barrierColor, position, menuOnChange, enablePassEvent.

📄 License #

Distributed under the BSD 3-Clause license. See LICENSE.

🔗 More Packages #


👨‍💻 Developer Card #

Younes M'rabti avatar

Younes M'rabti #

📧 Email: admin@youmti.net
🌐 Website: youmti.net
💼 LinkedIn: younesmrabti1996

15
likes
150
points
388
downloads

Publisher

verified publisheryoumti.net

Weekly Downloads

A popup menu containing clickable buttons, each with a global click function referring to the item. This is designed to avoid breaking the user's attention.

Homepage
Repository (GitHub)
View/report issues

Topics

#flutter #popup-menu #context-menu #bubble-menu #no-attention-break

Documentation

Documentation
API reference

License

BSD-3-Clause (license)

Dependencies

cupertino_icons, flutter

More

Packages that depend on popup_menu_2