Skip to content

Commit 442d910

Browse files
committed
feat: crash report
closes #114
1 parent 97bd998 commit 442d910

File tree

4 files changed

+146
-71
lines changed

4 files changed

+146
-71
lines changed

ios/Podfile.lock

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ PODS:
44
- Flutter
55
- package_info (0.0.1):
66
- Flutter
7+
- package_info_plus (0.4.5):
8+
- Flutter
9+
- Sentry (7.1.3):
10+
- Sentry/Core (= 7.1.3)
11+
- Sentry/Core (7.1.3)
12+
- sentry_flutter (0.0.1):
13+
- Flutter
14+
- FlutterMacOS
15+
- Sentry (~> 7.1.3)
716
- share (0.0.1):
817
- Flutter
918
- shared_preferences (0.0.1):
@@ -19,19 +28,29 @@ DEPENDENCIES:
1928
- Flutter (from `Flutter`)
2029
- launch_review (from `.symlinks/plugins/launch_review/ios`)
2130
- package_info (from `.symlinks/plugins/package_info/ios`)
31+
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
32+
- sentry_flutter (from `.symlinks/plugins/sentry_flutter/ios`)
2233
- share (from `.symlinks/plugins/share/ios`)
2334
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
2435
- uni_links (from `.symlinks/plugins/uni_links/ios`)
2536
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
2637
- webview_flutter (from `.symlinks/plugins/webview_flutter/ios`)
2738

39+
SPEC REPOS:
40+
trunk:
41+
- Sentry
42+
2843
EXTERNAL SOURCES:
2944
Flutter:
3045
:path: Flutter
3146
launch_review:
3247
:path: ".symlinks/plugins/launch_review/ios"
3348
package_info:
3449
:path: ".symlinks/plugins/package_info/ios"
50+
package_info_plus:
51+
:path: ".symlinks/plugins/package_info_plus/ios"
52+
sentry_flutter:
53+
:path: ".symlinks/plugins/sentry_flutter/ios"
3554
share:
3655
:path: ".symlinks/plugins/share/ios"
3756
shared_preferences:
@@ -47,6 +66,9 @@ SPEC CHECKSUMS:
4766
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
4867
launch_review: 75d5a956ba8eaa493e9c9d4bf4c05e505e8d5ed0
4968
package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62
69+
package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e
70+
Sentry: 6d963d64804dd06d96e778be729613f481394312
71+
sentry_flutter: f20d4f199442900fbdab2b8496f1d2091d8b94d9
5072
share: 0b2c3e82132f5888bccca3351c504d0003b3b410
5173
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
5274
uni_links: d97da20c7701486ba192624d99bffaaffcfc298a

lib/main.dart

Lines changed: 60 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -8,80 +8,69 @@ import 'package:git_touch/router.dart';
88
import 'package:provider/provider.dart';
99
import 'package:git_touch/models/notification.dart';
1010
import 'package:fluro/fluro.dart';
11-
import 'package:fimber/fimber.dart';
1211
import 'package:flutter/services.dart';
12+
import 'package:sentry_flutter/sentry_flutter.dart';
1313

1414
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+
]);
1731

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+
));
2464

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+
);
8776
}

pubspec.lock

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,48 @@ packages:
546546
url: "https://pub.dartlang.org"
547547
source: hosted
548548
version: "2.0.0"
549+
package_info_plus:
550+
dependency: transitive
551+
description:
552+
name: package_info_plus
553+
url: "https://pub.dartlang.org"
554+
source: hosted
555+
version: "1.0.2"
556+
package_info_plus_linux:
557+
dependency: transitive
558+
description:
559+
name: package_info_plus_linux
560+
url: "https://pub.dartlang.org"
561+
source: hosted
562+
version: "1.0.2"
563+
package_info_plus_macos:
564+
dependency: transitive
565+
description:
566+
name: package_info_plus_macos
567+
url: "https://pub.dartlang.org"
568+
source: hosted
569+
version: "1.1.1"
570+
package_info_plus_platform_interface:
571+
dependency: transitive
572+
description:
573+
name: package_info_plus_platform_interface
574+
url: "https://pub.dartlang.org"
575+
source: hosted
576+
version: "1.0.1"
577+
package_info_plus_web:
578+
dependency: transitive
579+
description:
580+
name: package_info_plus_web
581+
url: "https://pub.dartlang.org"
582+
source: hosted
583+
version: "1.0.2"
584+
package_info_plus_windows:
585+
dependency: transitive
586+
description:
587+
name: package_info_plus_windows
588+
url: "https://pub.dartlang.org"
589+
source: hosted
590+
version: "1.0.1"
549591
path:
550592
dependency: transitive
551593
description:
@@ -679,6 +721,20 @@ packages:
679721
url: "https://pub.dartlang.org"
680722
source: hosted
681723
version: "0.26.0"
724+
sentry:
725+
dependency: transitive
726+
description:
727+
name: sentry
728+
url: "https://pub.dartlang.org"
729+
source: hosted
730+
version: "5.1.0"
731+
sentry_flutter:
732+
dependency: "direct main"
733+
description:
734+
name: sentry_flutter
735+
url: "https://pub.dartlang.org"
736+
source: hosted
737+
version: "5.1.0"
682738
share:
683739
dependency: "direct main"
684740
description:
@@ -908,6 +964,13 @@ packages:
908964
url: "https://pub.dartlang.org"
909965
source: hosted
910966
version: "2.0.0"
967+
uuid:
968+
dependency: transitive
969+
description:
970+
name: uuid
971+
url: "https://pub.dartlang.org"
972+
source: hosted
973+
version: "3.0.4"
911974
vector_math:
912975
dependency: transitive
913976
description:

pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ dependencies:
5050
uri: ^1.0.0
5151
url_launcher: ^6.0.3
5252
webview_flutter: ^2.0.4
53+
sentry_flutter: ^5.1.0
5354

5455
dev_dependencies:
5556
flutter_test:

0 commit comments

Comments
 (0)