File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
platform-includes/enriching-events/attach-screenshots Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -19,3 +19,33 @@ Future<void> main() async {
19
19
);
20
20
}
21
21
```
22
+
23
+ ### Filtering Screenshots
24
+
25
+ You can filter your screenshots by using the ` beforeScreenshot ` callback.
26
+ It is called before taking a screenshot and if the callback returns ` false ` , the screenshot will not be attached.
27
+
28
+ ``` dart
29
+ import 'package:flutter/widgets.dart';
30
+ import 'package:sentry_flutter/sentry_flutter.dart';
31
+
32
+ Future<void> main() async {
33
+ await SentryFlutter.init(
34
+ (options) {
35
+ options.dsn = '___PUBLIC_DSN___';
36
+ options.attachScreenshot = true;
37
+ options.beforeScreenshot = (event, {hint}) {
38
+ // Return false if you don't want to attach the screenshot based on some condition.
39
+ return true;
40
+ };
41
+ },
42
+ appRunner: () => runApp(
43
+ // Wrap your app widget with the [SentryWidget] widget.
44
+ SentryWidget(
45
+ child: MyApp(),
46
+ ),
47
+ ),
48
+ );
49
+ }
50
+ ```
51
+
You can’t perform that action at this time.
0 commit comments