-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.dart
77 lines (71 loc) · 2.22 KB
/
main.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
import 'package:fluent_ui/fluent_ui.dart';
import 'dart:io';
import 'package:macos_ui/macos_ui.dart';
import 'package:flutter/cupertino.dart';
void main() {
if (Platform.isWindows || Platform.isLinux || Platform.isMacOS) {}
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MacosApp(
theme: MacosThemeData.light(),
darkTheme: MacosThemeData.dark(),
themeMode: ThemeMode.system,
debugShowCheckedModeBanner: false,
home: const HomePage(),
);
}
}
class HomePage extends StatelessWidget {
const HomePage({super.key});
@override
Widget build(BuildContext context) {
return Builder(
builder: (context) {
return MacosScaffold(
toolBar: ToolBar(
title: const Text('ToolBar Demo Bar'),
titleWidth: 200.0,
actions: [
ToolBarIconButton(
label: "Add",
icon: const MacosIcon(
CupertinoIcons.add_circled,
),
onPressed: () => debugPrint("Add..."),
showLabel: true,
),
const ToolBarSpacer(),
ToolBarIconButton(
label: "Delete",
icon: const MacosIcon(
CupertinoIcons.trash,
),
onPressed: () => debugPrint("Delete"),
showLabel: false,
),
ToolBarPullDownButton(
label: "Actions",
icon: CupertinoIcons.ellipsis_circle_fill,
items: [
MacosPulldownMenuItem(
label: "New File",
title: const Text("New File"),
onTap: () => debugPrint("Creating new file..."),
),
MacosPulldownMenuItem(
label: "Open File",
title: const Text("Open File"),
onTap: () => debugPrint("Opening file..."),
),
],
),
]),
);
},
);
}
}