-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.dart
78 lines (69 loc) · 2.1 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
78
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(
title: 'Button',
theme: MacosThemeData.light(),
darkTheme: MacosThemeData.dark(),
themeMode: ThemeMode.system,
debugShowCheckedModeBanner: false,
home: const HomePage(),
);
}
}
class HomePage extends StatefulWidget {
const HomePage({super.key});
@override
State<HomePage> createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
bool checkValue = false;
@override
Widget build(BuildContext context) {
final theme = MacosTheme.of(context);
return Builder(
builder: (context) {
return MacosScaffold(
children: [
ContentArea(
builder: (context, scrollController) {
return Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
MacosCheckbox(
value: checkValue,
onChanged: (value) {
setState(() => checkValue = value);
},
),
const SizedBox(width: 8),
const Text('Are you happy?'),
const SizedBox(width: 12),
PushButton(
buttonSize: ButtonSize.large,
child: const Text('Get response'),
onPressed: () => debugPrint(checkValue
? 'you are happy! :-)'
: 'you are not happy :`-('),
),
],
),
);
},
),
],
);
},
);
}
}