File tree 2 files changed +30
-25
lines changed
2 files changed +30
-25
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ A Flutter plugin for [Instabug](https://instabug.com/).
22
22
23
23
### Installation
24
24
25
-
26
25
1 . Add Instabug to your ` pubspec.yaml ` file.
27
26
28
27
``` yaml
@@ -65,18 +64,23 @@ Instabug automatically captures every crash of your app and sends relevant detai
65
64
66
65
``` dart
67
66
void main() {
68
- WidgetsFlutterBinding.ensureInitialized();
69
-
70
- Instabug.init(
71
- token: 'APP_TOKEN',
72
- invocationEvents: [InvocationEvent.floatingButton],
67
+ runZonedGuarded(
68
+ () {
69
+ WidgetsFlutterBinding.ensureInitialized();
70
+
71
+ Instabug.init(
72
+ token: 'APP_TOKEN',
73
+ invocationEvents: [InvocationEvent.shake],
74
+ );
75
+
76
+ FlutterError.onError = (FlutterErrorDetails details) {
77
+ Zone.current.handleUncaughtError(details.exception, details.stack!);
78
+ };
79
+
80
+ runApp(MyApp());
81
+ },
82
+ CrashReporting.reportCrash,
73
83
);
74
-
75
- FlutterError.onError = (FlutterErrorDetails details) {
76
- Zone.current.handleUncaughtError(details.exception, details.stack!);
77
- };
78
-
79
- runZonedGuarded(() => runApp(MyApp()), CrashReporting.reportCrash);
80
84
}
81
85
```
82
86
@@ -90,7 +94,6 @@ Repro Steps list all of the actions an app user took before reporting a bug or c
90
94
));
91
95
```
92
96
93
-
94
97
## Network Logging
95
98
You can choose to attach all your network requests to the reports being sent to the dashboard. To enable the feature when using the ` dart:io ` package ` HttpClient ` , please refer to the [ Instabug Dart IO Http Client] ( https://github.com/Instabug/instabug-dart-io-http-client ) repository.
96
99
Original file line number Diff line number Diff line change @@ -4,21 +4,23 @@ import 'package:flutter/material.dart';
4
4
import 'package:instabug_flutter/instabug_flutter.dart' ;
5
5
6
6
void main () {
7
- WidgetsFlutterBinding .ensureInitialized ();
7
+ runZonedGuarded (
8
+ () {
9
+ WidgetsFlutterBinding .ensureInitialized ();
8
10
9
- Instabug .init (
10
- token: 'ed6f659591566da19b67857e1b9d40ab' ,
11
- invocationEvents: [InvocationEvent .floatingButton],
12
- debugLogsLevel: LogLevel .verbose,
13
- );
14
-
15
- Instabug .setWelcomeMessageMode (WelcomeMessageMode .disabled);
11
+ Instabug .init (
12
+ token: 'ed6f659591566da19b67857e1b9d40ab' ,
13
+ invocationEvents: [InvocationEvent .floatingButton],
14
+ );
16
15
17
- FlutterError .onError = (FlutterErrorDetails details) {
18
- Zone .current.handleUncaughtError (details.exception, details.stack! );
19
- };
16
+ FlutterError .onError = (FlutterErrorDetails details) {
17
+ Zone .current.handleUncaughtError (details.exception, details.stack! );
18
+ };
20
19
21
- runZonedGuarded (() => runApp (MyApp ()), CrashReporting .reportCrash);
20
+ runApp (MyApp ());
21
+ },
22
+ CrashReporting .reportCrash,
23
+ );
22
24
}
23
25
24
26
class MyApp extends StatelessWidget {
You can’t perform that action at this time.
0 commit comments