Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MOB-12516] Fix zone mismatch issue #376

Merged
merged 2 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ A Flutter plugin for [Instabug](https://instabug.com/).

### Installation


1. Add Instabug to your `pubspec.yaml` file.

```yaml
Expand All @@ -44,14 +43,23 @@ Initialize the SDK in your `main` function. This starts the SDK with the default
import 'package:instabug_flutter/instabug_flutter.dart';

void main() {
WidgetsFlutterBinding.ensureInitialized();

Instabug.init(
token: 'APP_TOKEN',
invocationEvents: [InvocationEvent.shake],
runZonedGuarded(
() {
WidgetsFlutterBinding.ensureInitialized();

Instabug.init(
token: 'APP_TOKEN',
invocationEvents: [InvocationEvent.shake],
);

FlutterError.onError = (FlutterErrorDetails details) {
Zone.current.handleUncaughtError(details.exception, details.stack!);
};

runApp(MyApp());
},
CrashReporting.reportCrash,
asamiz marked this conversation as resolved.
Show resolved Hide resolved
);

runApp(MyApp());
}
```

Expand Down Expand Up @@ -90,7 +98,6 @@ Repro Steps list all of the actions an app user took before reporting a bug or c
));
```


## Network Logging
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.

Expand Down
26 changes: 14 additions & 12 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,23 @@ import 'package:flutter/material.dart';
import 'package:instabug_flutter/instabug_flutter.dart';

void main() {
WidgetsFlutterBinding.ensureInitialized();
runZonedGuarded(
() {
WidgetsFlutterBinding.ensureInitialized();

Instabug.init(
token: 'ed6f659591566da19b67857e1b9d40ab',
invocationEvents: [InvocationEvent.floatingButton],
debugLogsLevel: LogLevel.verbose,
);

Instabug.setWelcomeMessageMode(WelcomeMessageMode.disabled);
Instabug.init(
token: 'ed6f659591566da19b67857e1b9d40ab',
invocationEvents: [InvocationEvent.floatingButton],
);

FlutterError.onError = (FlutterErrorDetails details) {
Zone.current.handleUncaughtError(details.exception, details.stack!);
};
FlutterError.onError = (FlutterErrorDetails details) {
Zone.current.handleUncaughtError(details.exception, details.stack!);
};

runZonedGuarded(() => runApp(MyApp()), CrashReporting.reportCrash);
runApp(MyApp());
},
CrashReporting.reportCrash,
);
}

class MyApp extends StatelessWidget {
Expand Down