menu_base 0.1.1 copy "menu_base: ^0.1.1" to clipboard
menu_base: ^0.1.1 copied to clipboard

Used to create context or tray menus.

menu_base #

pub version

Used to create context or tray menus.


Quick Start #

Installation #

Add this to your package's pubspec.yaml file:

dependencies:
  menu_base: ^0.1.0

Or

dependencies:
  window_manager:
    git:
      url: https://github.com/leanflutter/menu_base.git
      ref: main

Usage #

import 'package:flutter/material.dart' hide MenuItem;
import 'package:menu_base/menu_base.dart';

Menu menu = Menu(
  items: [
    MenuItem(
      label: 'Copy',
      onClick: (_) {
        BotToast.showText(text: 'Clicked Copy');
      },
    ),
    MenuItem(
      label: 'Disabled item',
      disabled: true,
    ),
    MenuItem.separator(),
    MenuItem.submenu(
      label: 'Submenu',
      submenu: Menu(
        items: [
          MenuItem.checkbox(
            key: 'checkbox1',
            label: 'Checkbox1',
            checked: true,
            onClick: (menuItem) {
              menuItem.checked = !(menuItem.checked == true);
            },
          ),
          MenuItem.checkbox(
            label: 'Checkbox2',
            checked: false,
          ),
          MenuItem.checkbox(
            label: 'Checkbox3',
            checked: null,
          ),
        ],
      ),
    ),
  ],
);

License #

MIT

1
likes
130
points
14.1k
downloads

Publisher

verified publisherleanflutter.dev

Weekly Downloads

Used to create context or tray menus.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on menu_base