Skip to content

Commit 705a12e

Browse files
committed
fix import and changelog
1 parent 90a88c9 commit 705a12e

File tree

2 files changed

+28
-21
lines changed

2 files changed

+28
-21
lines changed

CHANGELOG.md

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,32 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
### Features
6+
7+
- Support custom `Sentry.runZoneGuarded` zone creation ([#2088](https://github.com/getsentry/sentry-dart/pull/2088))
8+
- Sentry will not create a custom zone anymore if it is started within a custom one.
9+
- This fixes Zone miss-match errors when trying to initialize WidgetsBinding before Sentry on Flutter Web
10+
- `Sentry.runZonedGuarded` creates a zone and also captures exceptions & breadcrumbs automatically.
11+
```dart
12+
Sentry.runZonedGuarded(() {
13+
WidgetsBinding.ensureInitialized();
14+
15+
// Errors before init will not be handled by Sentry
16+
17+
SentryFlutter.init(
18+
(options) {
19+
...
20+
},
21+
appRunner: () => runApp(MyApp()),
22+
);
23+
} (error, stackTrace) {
24+
// Automatically sends errors to Sentry, no need to do any
25+
// captureException calls on your part.
26+
// On top of that, you can do your own custom stuff in this callback.
27+
});
28+
```
29+
330
## 8.11.0-beta.2
431

532
### Features
@@ -49,28 +76,7 @@
4976
});
5077
```
5178
- Replace deprecated `BeforeScreenshotCallback` with new `BeforeCaptureCallback`.
52-
- Support custom `Sentry.runZoneGuarded` zone creation ([#2088](https://github.com/getsentry/sentry-dart/pull/2088))
53-
- Sentry will not create a custom zone anymore if it is started within a custom one.
54-
- This fixes Zone miss-match errors when trying to initialize WidgetsBinding before Sentry on Flutter Web
55-
- `Sentry.runZonedGuarded` creates a zone and also captures exceptions & breadcrumbs automatically.
56-
```dart
57-
Sentry.runZonedGuarded(() {
58-
WidgetsBinding.ensureInitialized();
5979

60-
// Errors before init will not be handled by Sentry
61-
62-
SentryFlutter.init(
63-
(options) {
64-
...
65-
},
66-
appRunner: () => runApp(MyApp()),
67-
);
68-
} (error, stackTrace) {
69-
// Automatically sends errors to Sentry, no need to do any
70-
// captureException calls on your part.
71-
// On top of that, you can do your own custom stuff in this callback.
72-
});
73-
```
7480

7581
### Fixes
7682

dart/test/sentry_run_zoned_guarded_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ library dart_test;
44
import 'dart:async';
55

66
import 'package:sentry/sentry.dart';
7+
import 'package:sentry/src/sentry_run_zoned_guarded.dart';
78
import 'package:test/test.dart';
89

910
import 'mocks/mock_hub.dart';

0 commit comments

Comments
 (0)