-
Notifications
You must be signed in to change notification settings - Fork 78
/
Copy pathdemo.dart
90 lines (85 loc) · 2.08 KB
/
demo.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
import 'package:flutter/material.dart';
import 'package:flutter_radial_menu/flutter_radial_menu.dart';
enum MenuOptions {
unread,
share,
archive,
delete,
backup,
copy,
}
void main() {
GlobalKey<RadialMenuState> _menuKey = new GlobalKey<RadialMenuState>();
final List<RadialMenuItem<MenuOptions>> items = <RadialMenuItem<MenuOptions>>[
new RadialMenuItem<MenuOptions>(
value: MenuOptions.unread,
child: new Icon(
Icons.markunread,
),
iconColor: Colors.white,
backgroundColor: Colors.blue[400],
tooltip: 'unread',
),
new RadialMenuItem<MenuOptions>(
value: MenuOptions.share,
child: new Icon(
Icons.share,
),
iconColor: Colors.white,
backgroundColor: Colors.green[400],
),
new RadialMenuItem<MenuOptions>(
value: MenuOptions.archive,
child: new Icon(
Icons.archive,
),
iconColor: Colors.white,
backgroundColor: Colors.yellow[400],
),
new RadialMenuItem<MenuOptions>(
value: MenuOptions.delete,
child: new Icon(
Icons.delete,
),
iconColor: Colors.white,
backgroundColor: Colors.red[400],
),
new RadialMenuItem<MenuOptions>(
value: MenuOptions.backup,
child: new Icon(
Icons.backup,
),
iconColor: Colors.white,
backgroundColor: Colors.black,
),
new RadialMenuItem<MenuOptions>(
value: MenuOptions.copy,
child: new Icon(
Icons.content_copy,
),
iconColor: Colors.white,
backgroundColor: Colors.indigo[400],
),
];
void _onItemSelected(MenuOptions value) {
print(value);
}
runApp(
new MaterialApp(
home: new Scaffold(
body: new Center(
child: new RadialMenu(
key: _menuKey,
items: items,
radius: 100.0,
onSelected: _onItemSelected,
),
),
floatingActionButton: new FloatingActionButton(
child: new Icon(Icons.restore),
onPressed: () => _menuKey.currentState.reset(),
),
),
),
);
}