-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.dart
40 lines (35 loc) · 1.06 KB
/
app.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
import 'package:flutter/material.dart';
import 'app_theme.dart';
import 'components/util/reactive.dart';
import 'global_error_widget.dart';
import 'model/auth/auth_widget.dart';
import 'notifications_service_widget.dart';
import 'routes.dart';
import 'service_locator.dart';
var appTheme = AppTheme();
class App extends StatelessWidget {
final GlobalAppThemeConfig globalAppThemeConfig = sl();
App({super.key});
@override
Widget build(BuildContext context) {
return Reactive(
globalAppThemeConfig,
builder: (context, appThemeConfig) => MaterialApp.router(
routerConfig: mainRouter,
theme: appTheme.light,
darkTheme: appTheme.dark,
themeMode: appThemeConfig.themeMode,
builder: (context, child) {
return NotificationsServiceWidget(
child: GlobalErrorWidget(
child: GlobalAuthWidget(
navigatorKey: mainRouter.routerDelegate.navigatorKey,
child: child ?? const SizedBox(),
),
),
);
},
),
);
}
}