Skip to content

Commit db634d0

Browse files
authored
Add screenshots support for Flutter (#5745)
1 parent 493457a commit db634d0

File tree

6 files changed

+24
-1
lines changed

6 files changed

+24
-1
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
```dart
2+
import 'package:flutter/widgets.dart';
3+
import 'package:sentry_flutter/sentry_flutter.dart';
4+
5+
Future<void> main() async {
6+
await SentryFlutter.init(
7+
(options) {
8+
options.dsn = '___PUBLIC_DSN___';
9+
options.attachScreenshot = true;
10+
},
11+
appRunner: () => runApp(
12+
// Wrap your app widget with the [SentryScreenshotWidget] widget.
13+
SentryScreenshotWidget(
14+
child: MyApp(),
15+
),
16+
),
17+
);
18+
}
19+
```

src/platform-includes/getting-started-primer/android.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ The SDK builds a crash report that persists to disk and tries to send the report
3939
- Distributed tracing through [OkHttp](/platforms/android/configuration/integrations/okhttp/) and [Apollo](/platforms/android/configuration/integrations/apollo/) integrations
4040
- [Application Not Responding (ANR)](/platforms/android/configuration/app-not-respond/) reported if the application is blocked for more than five seconds
4141
- [HTTP Client Errors](/platforms/android/configuration/integrations/okhttp/#http-client-errors)
42+
- [Screenshot attachments for errors](/platforms/android/enriching-events/screenshots/)
4243
- Code samples provided in both Kotlin and Java as the Android SDK uses both languages
4344
- We provide a [sample application](https://github.com/getsentry/sentry-java/tree/master/sentry-samples/sentry-samples-android) for our Android users
4445
- Our [video tutorial](/platforms/android/android-video/) visually demonstrates how to set up our SDK

src/platform-includes/getting-started-primer/apple.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,4 @@
3333
- <PlatformLink to="/performance/instrumentation/automatic-instrumentation/#user-interaction-tracing">User Interaction</PlatformLink> transactions for UI clicks (experimental)
3434
- [Attachments](/platforms/apple/enriching-events/attachments/) enrich your event by storing additional files, such as config or log files
3535
- [User Feedback](/platforms/apple/enriching-events/user-feedback/) provides the ability to collect user information when an event occurs
36+
- [Screenshot attachments for errors](/platforms/apple/guides/ios/enriching-events/screenshots/)

src/platform-includes/getting-started-primer/flutter.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@ Features:
2929
- [Slow and frozen frames](/platforms/flutter/performance/instrumentation/automatic-instrumentation/#slow-and-frozen-frames)
3030
- [AssetBundle Instrumentation](/platforms/flutter/performance/instrumentation/automatic-instrumentation/#assetbundle-instrumentation)
3131
- [Logging Integration](/platforms/dart/configuration/integrations/logging)
32+
- [Screenshot attachments for errors](/platforms/flutter/enriching-events/screenshots/)
3233
- Limited support for Flutter Web, Windows, and Linux
3334
- Under the hood the SDK relies on the [Dart SDK](/platforms/dart/); the minimum required version is `2.12.0` and Flutter SDK version is `1.17.0`.

src/platforms/common/configuration/options.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ This is the maximum number of properties or entries that will be included in any
413413

414414
</ConfigKey>
415415

416-
<ConfigKey name="attach-screenshot" supported={["android", "apple.ios", "unity", "dotnet.xamarin"]}>
416+
<ConfigKey name="attach-screenshot" supported={["android", "apple.ios", "unity", "dotnet.xamarin", "flutter"]}>
417417

418418
Takes a screenshot of the application when an error happens and includes it as an attachment.
419419
Learn more about enriching events with screenshots in our <PlatformLink to="/enriching-events/screenshots/">Screenshots documentation</PlatformLink>.

src/platforms/common/enriching-events/screenshots.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ supported:
88
- unity
99
- dotnet.xamarin
1010
- javascript.electron
11+
- flutter
1112
notSupported:
1213
- apple.macos
1314
- apple.tvos

0 commit comments

Comments
 (0)