Last updated:
0 purchases
flutter desktop context menu
Desktop Context Menu #
A package that spawns a context menu at the mouse coordinates.
Available for MacOS, Windows and Linux.
Hotkeys available only for MacOS.
flutter_desktop_context_menu
Platform Support
Screenshots
Quick Start
Installation
Usage
Who's using it?
Related Links
License
Platform Support #
Linux
macOS
Windows
✔️
✔️
✔️
Screenshots #
macOS
Linux
Windows
Quick Start #
Installation #
Add this to your package's pubspec.yaml file:
dependencies:
flutter_desktop_context_menu: ^0.2.0
copied to clipboard
Usage #
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_desktop_context_menu/flutter_desktop_context_menu.dart';
Menu menu = Menu(
items: [
MenuItem(
label: 'Copy',
shortcutKey: 'c',
shortcutModifiers: ShortcutModifiers(
control: Platform.isWindows, meta: Platform.isMacOS),
onClick: (_) {
print('Clicked Copy');
},
),
MenuItem(
label: 'Disabled item',
disabled: true,
),
MenuItem.checkbox(
key: 'checkbox1',
label: 'Checkbox1',
toolTip: 'Checkbox 1',
checked: true,
onClick: (menuItem) {
print('Clicked Checkbox1');
menuItem.checked = !(menuItem.checked == true);
},
),
MenuItem.separator(),
],
);
popUpContextualMenu(
menu,
placement: Placement.bottomLeft,
);
copied to clipboard
Please see the example app of this plugin for a full example.
License #
MIT
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.