Skip to content

youmtinetflutterpacks/popup_menu_2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

35 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors