Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
denrase committed Dec 17, 2024
1 parent 64ea81b commit bf10465
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/platforms/flutter/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,14 @@ Future<void> main() async {
}
```

```dart {tabTitle:Flutter Web} {"onboardingOptions": {"performance": "13-15", "profiling": "16-19"}}
```dart {tabTitle:With custom zone} {"onboardingOptions": {"performance": "16-18", "profiling": "19-22"}}
import 'package:flutter/widgets.dart';
import 'package:sentry_flutter/sentry_flutter.dart';
Future<void> main() async {
// By using Sentry.runZonedGuarded you can have a custom Zone, where you can call `WidgetsBinding` before `SentryFlutter.init`, with automatic error and breadcrumb reporting.
// The SDK creates it's own custom zone on web for automatic error and breadcrumb tracking on web.
// This could lead to zone mismatch errors if you needed to call `WidgetsBinding.ensureInitialized()` before Sentry in a cusom zone.
// With `Sentry.runZonedGuarded` you still get convenient auto error and breadcrumb tracking and can also call `WidgetsBinding.ensureInitialized()` before Sentry.
Sentry.runZonedGuarded(() async {
WidgetsBinding.ensureInitialized();
Expand Down

0 comments on commit bf10465

Please sign in to comment.