-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.dart
33 lines (27 loc) · 1015 Bytes
/
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
import 'package:fluent_ui/fluent_ui.dart';
import 'package:oghref_fluent/oghref_fluent.dart';
import 'package:provider/provider.dart';
import 'app.dart';
import 'theme_preference.dart';
void main() {
WidgetsFlutterBinding.ensureInitialized();
OgHrefFluentBinding.ensureInitialized();
runApp(const OgHrefFluentExampleApp());
}
class OgHrefFluentExampleApp extends StatelessWidget {
const OgHrefFluentExampleApp({super.key});
@override
Widget build(BuildContext context) {
return ChangeNotifierProvider<ThemePreference>(
create: (_) => ThemePreference(),
builder: (context, child) {
final pref = context.watch<ThemePreference>();
return FluentApp(
home: const OgHrefFluentExampleHome(),
themeMode: pref.darkMode ? ThemeMode.dark : ThemeMode.light,
theme: FluentThemeData()
.copyWith(scaffoldBackgroundColor: Colors.blue.lightest),
darkTheme: FluentThemeData.dark());
});
}
}