@@ -8,80 +8,69 @@ import 'package:git_touch/router.dart';
8
8
import 'package:provider/provider.dart' ;
9
9
import 'package:git_touch/models/notification.dart' ;
10
10
import 'package:fluro/fluro.dart' ;
11
- import 'package:fimber/fimber.dart' ;
12
11
import 'package:flutter/services.dart' ;
12
+ import 'package:sentry_flutter/sentry_flutter.dart' ;
13
13
14
14
void main () async {
15
- WidgetsFlutterBinding .ensureInitialized ();
16
- // Platform messages may fail, so we use a try/catch PlatformException.
15
+ await SentryFlutter .init (
16
+ (options) {
17
+ options.dsn =
18
+ 'https://[email protected] /5814819' ;
19
+ },
20
+ // Init your App.
21
+ appRunner: () async {
22
+ final notificationModel = NotificationModel ();
23
+ final themeModel = ThemeModel ();
24
+ final authModel = AuthModel ();
25
+ final codeModel = CodeModel ();
26
+ await Future .wait ([
27
+ themeModel.init (),
28
+ authModel.init (),
29
+ codeModel.init (),
30
+ ]);
17
31
18
- // try {
19
- // String initialLink = await getInitialLink();
20
- // Fimber.d(initialLink);
21
- // } on PlatformException {
22
- // Fimber.d('test');
23
- // }
32
+ CommonRouter .routes.forEach ((screen) {
33
+ themeModel.router.define (CommonRouter .prefix + screen.path,
34
+ handler: Handler (handlerFunc: screen.handler));
35
+ });
36
+ GitlabRouter .routes.forEach ((screen) {
37
+ themeModel.router.define (GitlabRouter .prefix + screen.path,
38
+ handler: Handler (handlerFunc: screen.handler));
39
+ });
40
+ GiteaRouter .routes.forEach ((screen) {
41
+ themeModel.router.define (GiteaRouter .prefix + screen.path,
42
+ handler: Handler (handlerFunc: screen.handler));
43
+ });
44
+ BitbucketRouter .routes.forEach ((screen) {
45
+ themeModel.router.define (BitbucketRouter .prefix + screen.path,
46
+ handler: Handler (handlerFunc: screen.handler));
47
+ });
48
+ GithubRouter .routes.forEach ((screen) {
49
+ themeModel.router.define (GithubRouter .prefix + screen.path,
50
+ handler: Handler (handlerFunc: screen.handler));
51
+ });
52
+ GiteeRouter .routes.forEach ((screen) {
53
+ themeModel.router.define (GiteeRouter .prefix + screen.path,
54
+ handler: Handler (handlerFunc: screen.handler));
55
+ });
56
+ GogsRouter .routes.forEach ((screen) {
57
+ themeModel.router.define (GogsRouter .prefix + screen.path,
58
+ handler: Handler (handlerFunc: screen.handler));
59
+ });
60
+ // To match status bar color to app bar color
61
+ SystemChrome .setSystemUIOverlayStyle (SystemUiOverlayStyle (
62
+ statusBarColor: Colors .transparent,
63
+ ));
24
64
25
- // DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
26
- // AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
27
- // Fimber.d('Running on ${androidInfo.model}'); // e.g. "Moto G (4)"
28
-
29
- // IosDeviceInfo iosInfo = await deviceInfo.iosInfo;
30
- // Fimber.d('Running on ${iosInfo.utsname.machine}'); // e.g. "iPod7,1"
31
-
32
- // TODO: Later, should check to enable debug log in debug build only
33
- Fimber .plantTree (DebugTree ());
34
-
35
- final notificationModel = NotificationModel ();
36
- final themeModel = ThemeModel ();
37
- final authModel = AuthModel ();
38
- final codeModel = CodeModel ();
39
- await Future .wait ([
40
- themeModel.init (),
41
- authModel.init (),
42
- codeModel.init (),
43
- ]);
44
-
45
- CommonRouter .routes.forEach ((screen) {
46
- themeModel.router.define (CommonRouter .prefix + screen.path,
47
- handler: Handler (handlerFunc: screen.handler));
48
- });
49
- GitlabRouter .routes.forEach ((screen) {
50
- themeModel.router.define (GitlabRouter .prefix + screen.path,
51
- handler: Handler (handlerFunc: screen.handler));
52
- });
53
- GiteaRouter .routes.forEach ((screen) {
54
- themeModel.router.define (GiteaRouter .prefix + screen.path,
55
- handler: Handler (handlerFunc: screen.handler));
56
- });
57
- BitbucketRouter .routes.forEach ((screen) {
58
- themeModel.router.define (BitbucketRouter .prefix + screen.path,
59
- handler: Handler (handlerFunc: screen.handler));
60
- });
61
- GithubRouter .routes.forEach ((screen) {
62
- themeModel.router.define (GithubRouter .prefix + screen.path,
63
- handler: Handler (handlerFunc: screen.handler));
64
- });
65
- GiteeRouter .routes.forEach ((screen) {
66
- themeModel.router.define (GiteeRouter .prefix + screen.path,
67
- handler: Handler (handlerFunc: screen.handler));
68
- });
69
- GogsRouter .routes.forEach ((screen) {
70
- themeModel.router.define (GogsRouter .prefix + screen.path,
71
- handler: Handler (handlerFunc: screen.handler));
72
- });
73
- // To match status bar color to app bar color
74
- SystemChrome .setSystemUIOverlayStyle (SystemUiOverlayStyle (
75
- statusBarColor: Colors .transparent,
76
- ));
77
-
78
- runApp (MultiProvider (
79
- providers: [
80
- ChangeNotifierProvider (create: (context) => notificationModel),
81
- ChangeNotifierProvider (create: (context) => themeModel),
82
- ChangeNotifierProvider (create: (context) => authModel),
83
- ChangeNotifierProvider (create: (context) => codeModel),
84
- ],
85
- child: MyApp (),
86
- ));
65
+ runApp (MultiProvider (
66
+ providers: [
67
+ ChangeNotifierProvider (create: (context) => notificationModel),
68
+ ChangeNotifierProvider (create: (context) => themeModel),
69
+ ChangeNotifierProvider (create: (context) => authModel),
70
+ ChangeNotifierProvider (create: (context) => codeModel),
71
+ ],
72
+ child: MyApp (),
73
+ ));
74
+ },
75
+ );
87
76
}
0 commit comments