Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/leanflutter/menu_base
https://github.com/leanflutter/menu_base
Last synced: 4 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/leanflutter/menu_base
- Owner: leanflutter
- License: mit
- Created: 2022-05-06T15:41:59.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-06-10T20:23:21.000Z (over 2 years ago)
- Last Synced: 2024-03-25T21:42:10.285Z (8 months ago)
- Language: Dart
- Homepage: https://pub.dev/packages/menu_base
- Size: 7.81 KB
- Stars: 5
- Watchers: 2
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# menu_base
[![pub version][pub-image]][pub-url]
[pub-image]: https://img.shields.io/pub/v/menu_base.svg
[pub-url]: https://pub.dev/packages/menu_baseUsed to create context or tray menus.
---
- [menu_base](#menu_base)
- [Quick Start](#quick-start)
- [Installation](#installation)
- [Usage](#usage)
- [Related Links](#related-links)
- [License](#license)## Quick Start
### Installation
Add this to your package's pubspec.yaml file:
```yaml
dependencies:
menu_base: ^0.1.0
```Or
```yaml
dependencies:
window_manager:
git:
url: https://github.com/leanflutter/menu_base.git
ref: main
```### Usage
```dart
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,
),
],
),
),
],
);
```## Related Links
- https://github.com/leanflutter/contextual_menu
- https://github.com/leanflutter/tray_manager## License
[MIT](./LICENSE)