Skip to content

Flutter as framework of Dart #12866

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

Merged
merged 14 commits into from
Mar 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# /src/wizard/android/ @getsentry/team-mobile-core
# /src/platforms/apple/ @getsentry/team-mobile-core
# /src/wizard/apple/ @getsentry/team-mobile-core
# /src/platforms/flutter/ @getsentry/team-mobile-cross-platform
# /src/platforms/dart/guides/flutter/ @getsentry/team-mobile-cross-platform
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this actually has no effect since the path is not correct for any of these, but we'll fix that in a separate pr

# /src/wizard/flutter/ @getsentry/team-mobile-cross-platform
# /src/platforms/dart/ @getsentry/team-mobile-cross-platform
# /src/wizard/dart/ @getsentry/team-mobile-cross-platform
Expand Down
2 changes: 1 addition & 1 deletion docs/platforms/dart/configuration/releases.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ After configuring your SDK, you can install a repository integration or manually

<Alert>

Looking for Flutter release health? [See the Flutter documentation](/platforms/flutter/configuration/releases/#release-health).
Looking for Flutter release health? [See the Flutter documentation](/platforms/dart/guides/flutter/configuration/releases/#release-health).

</Alert>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ An optional property that configures which features are in experimental mode. Th

Set this boolean to `false` to disable the auto initialization of the native layer SDK. Doing so means you will need to initialize the native SDK manually. Do not use this to disable the native layer.

You should follow the [guide to native initialization](/platforms/flutter/native-init/) if you chose to use this option.
You should follow the [guide to native initialization](/platforms/dart/guides/flutter/native-init/) if you chose to use this option.

</ConfigKey>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ To monitor errors and performance in web views of Flutter applications, you need

## Application Monitoring

The Sentry Flutter SDK doesn't interact with the mobile application's web views. To monitor errors and performance in the Flutter part of the application follow the [Sentry Flutter SDK setup instructions](/platforms/flutter/).
The Sentry Flutter SDK doesn't interact with the mobile application's web views. To monitor errors and performance in the Flutter part of the application follow the [Sentry Flutter SDK setup instructions](/platforms/dart/guides/flutter/).

## WebView Monitoring

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ See [Creating Source Bundles](/cli/dif/#creating-source-bundles) for more inform

<Alert>

For Flutter Android, iOS, and macOS, follow the instructions in the [Debug Symbols](/platforms/flutter/upload-debug/#uploading-source-code-context-for-flutter-android-ios-and-macos) guide.
For Flutter Android, iOS, and macOS, follow the instructions in the [Debug Symbols](/platforms/dart/guides/flutter/upload-debug/#uploading-source-code-context-for-flutter-android-ios-and-macos) guide.

</Alert>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ brew install getsentry/tools/sentry-wizard && sentry-wizard -i flutter
npx @sentry/wizard@latest -i flutter
```

[Sentry Wizard](https://github.com/getsentry/sentry-wizard) will patch your project accordingly, though you can [set up manually](/platforms/flutter/manual-setup/) if you prefer. You only need to patch the project once. Then you can add the patched files to your version control system.
[Sentry Wizard](https://github.com/getsentry/sentry-wizard) will patch your project accordingly, though you can [set up manually](/platforms/dart/guides/flutter/manual-setup/) if you prefer. You only need to patch the project once. Then you can add the patched files to your version control system.


<Expandable title="The following tasks will be performed by the Sentry Wizard">

Expand Down Expand Up @@ -77,7 +78,7 @@ Future<void> main() async {
// Note: Profiling alpha is available for iOS and macOS since SDK version 7.12.0
options.profilesSampleRate = 1.0;
// Adds request headers and IP for users,
// visit: https://docs.sentry.io/platforms/flutter/data-management/data-collected/ for more info
// visit: https://docs.sentry.io/platforms/dart/guides/flutter/data-management/data-collected/ for more info
options.sendDefaultPii = true;
},
appRunner: () => runApp(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ While the SDK differentiates between cold and warm starts, it doesn't track hot

Before starting, ensure:

1. The Sentry Flutter SDK is initialized. Learn more [here](/platforms/flutter/#configure)
2. Tracing is set up. Learn more [here](/platforms/flutter/tracing/).
1. The Sentry Flutter SDK is initialized. Learn more [here](/platforms/dart/guides/flutter/#configure)
2. Tracing is set up. Learn more [here](/platforms/dart/guides/flutter/tracing/).

## Configure

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ The instrumentation starts a span from an active transaction that's bound to the

Before starting, ensure:

1. The Sentry Flutter SDK is initialized. Learn more [here](/platforms/flutter/#configure).
2. Tracing is set up. Learn more [here](/platforms/flutter/tracing/).
1. The Sentry Flutter SDK is initialized. Learn more [here](/platforms/dart/guides/flutter/#configure).
2. Tracing is set up. Learn more [here](/platforms/dart/guides/flutter/tracing/).

## Configure

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ The created spans will be attached to the transaction on the scope - if no trans

Before starting, ensure:

1. The Sentry Flutter SDK is initialized. Learn more [here](/platforms/flutter/#configure).
2. Tracing is set up. Learn more [here](/platforms/flutter/tracing/).
1. The Sentry Flutter SDK is initialized. Learn more [here](/platforms/dart/guides/flutter/#configure).
2. Tracing is set up. Learn more [here](/platforms/dart/guides/flutter/tracing/).

## Install

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ The created spans will be attached to the transaction on the scope - if no trans

Before starting, ensure:

1. The Sentry Flutter SDK is initialized. Learn more [here](/platforms/flutter/#configure).
2. Tracing is set up. Learn more [here](/platforms/flutter/tracing/).
1. The Sentry Flutter SDK is initialized. Learn more [here](/platforms/dart/guides/flutter/#configure).
2. Tracing is set up. Learn more [here](/platforms/dart/guides/flutter/tracing/).

## Install

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ The created spans will be attached to the transaction on the scope. If no transa

Before starting, ensure:

1. The Sentry Flutter SDK is initialized. Learn more [here](/platforms/flutter/#configure).
2. Tracing is set up. Learn more [here](/platforms/flutter/tracing/).
1. The Sentry Flutter SDK is initialized. Learn more [here](/platforms/dart/guides/flutter/#configure).
2. Tracing is set up. Learn more [here](/platforms/dart/guides/flutter/tracing/).

## Install

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ The routing instrumentation feature is shipped with Sentry's Flutter SDK automat

Before starting, ensure:

1. The Sentry Flutter SDK is initialized. Learn more [here](/platforms/flutter/#configure).
2. Tracing is set up. Learn more [here](/platforms/flutter/tracing/).
1. The Sentry Flutter SDK is initialized. Learn more [here](/platforms/dart/guides/flutter/#configure).
2. Tracing is set up. Learn more [here](/platforms/dart/guides/flutter/tracing/).

## Configure

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ Frame duration tracking begins automatically when a span starts. The integration

Before starting, ensure:

1. The Sentry Flutter SDK is initialized. Learn more [here](/platforms/flutter/#configure).
2. Tracing is set up. Learn more [here](/platforms/flutter/tracing/).
1. The Sentry Flutter SDK is initialized. Learn more [here](/platforms/dart/guides/flutter/#configure).
2. Tracing is set up. Learn more [here](/platforms/dart/guides/flutter/tracing/).

## Configure

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ The [sentry_sqflite](https://pub.dev/packages/sentry_sqflite) package provides `

Before starting, ensure:

1. The Sentry Flutter SDK is initialized. Learn more [here](/platforms/flutter/#configure).
2. Tracing is set up. Learn more [here](/platforms/flutter/tracing/).
1. The Sentry Flutter SDK is initialized. Learn more [here](/platforms/dart/guides/flutter/#configure).
2. Tracing is set up. Learn more [here](/platforms/dart/guides/flutter/tracing/).

## Install

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ Before diving into the configuration, it's important to understand how user inte

- The instrumentation sets the transaction name specified in the `key` of the `Widget` from the `key` of the `Widget`, for example `login_button`.
- The transaction operation is set to `ui.action.click`.
- If the user interaction transaction has reached the [idleTimeout](/platforms/flutter/configuration/options/#idle-timeout), but didn't have any child spans added, it will be dropped.
- If the user interaction transaction has reached the [idleTimeout](/platforms/dart/guides/flutter/configuration/options/#idle-timeout), but didn't have any child spans added, it will be dropped.

## Prerequisites

Before starting, ensure:

1. The Sentry Flutter SDK is initialized. Learn more [here](/platforms/flutter/#configure).
2. Tracing is set up. Learn more [here](/platforms/flutter/tracing/).
1. The Sentry Flutter SDK is initialized. Learn more [here](/platforms/dart/guides/flutter/#configure).
2. Tracing is set up. Learn more [here](/platforms/dart/guides/flutter/tracing/).

## Configure

Expand Down Expand Up @@ -132,7 +132,7 @@ Future<void> main() async {

### Transaction Timeout

The transaction finishes automatically after it reaches the specified [idleTimeout](/platforms/flutter/configuration/options/#idle-timeout) and all of its child spans are finished.
The transaction finishes automatically after it reaches the specified [idleTimeout](/platforms/dart/guides/flutter/configuration/options/#idle-timeout) and all of its child spans are finished.
The `idleTimeoout` defaults to `3000` milliseconds (3 seconds).

#### Disable Timeout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebar_order: 1
description: "Learn how to set up the SDK manually."
---

If you can't (or prefer not to) run the [automatic setup](/platforms/flutter/#install), you can follow the instructions below to configure your application manually.
If you can't (or prefer not to) run the [automatic setup](/platforms/dart/guides/flutter/#install), you can follow the instructions below to configure your application manually.

## Install

Expand Down Expand Up @@ -43,7 +43,7 @@ Future<void> main() async {
// Note: Profiling alpha is available for iOS and macOS since SDK version 7.12.0
options.profilesSampleRate = 1.0;
// Adds request headers and IP for users,
// visit: https://docs.sentry.io/platforms/flutter/data-management/data-collected/ for more info
// visit: https://docs.sentry.io/platforms/dart/guides/flutter/data-management/data-collected/ for more info
options.sendDefaultPii = true;
},
appRunner: () => runApp(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sidebar_order: 12

By default, the Flutter SDK initializes the native SDK underneath the `init` method called on the Flutter layer. As a result, the SDK currently has a limitation of not capturing native crashes that occur prior to the `init` method being called on the Flutter layer. You can initialize the native SDKs yourself to overcome this limitation or if you want to provide custom options above what the Flutter SDK currently provides.

To do this, set [autoInitializeNativeSdk](/platforms/flutter/configuration/options/#autoInitializeNativeSdk) to `false` in the init options:
To do this, set [autoInitializeNativeSdk](/platforms/dart/guides/flutter/configuration/options/#autoInitializeNativeSdk) to `false` in the init options:


```dart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ Capturing transactions requires that you first <PlatformLink to="/tracing/">set
Sentry's routing instrumentation in Flutter automatically tracks and reports page navigation events in your app.
It supports both [standard Flutter routing](https://docs.flutter.dev/ui/navigation) and the [GoRouter](https://pub.dev/packages/go_router) package.

Learn more in our [Routing Instrumentation](/platforms/flutter/integrations/routing-instrumentation/) docs.
Learn more in our [Routing Instrumentation](/platforms/dart/guides/flutter/integrations/routing-instrumentation/) docs.

### User Interaction

Sentry's user interaction instrumentation captures transactions and adds breadcrumbs for a set of different user interactions, which include clicks, long clicks, taps, and so on.

Learn more in our [User Interaction Instrumentation](/platforms/flutter/integrations/user-interaction-instrumentation/) docs.
Learn more in our [User Interaction Instrumentation](/platforms/dart/guides/flutter/integrations/user-interaction-instrumentation/) docs.

### http.Client Library

Expand All @@ -39,21 +39,21 @@ Learn more in our [Dio Instrumentation](/platforms/dart/integrations/dio/#perfor

The app start instrumentation provides insight into how long your application takes to launch.

Learn more in our [App Start Instrumentation](/platforms/flutter/integrations/app-start-instrumentation/) docs.
Learn more in our [App Start Instrumentation](/platforms/dart/guides/flutter/integrations/app-start-instrumentation/) docs.

### Slow and Frozen Frames

Unresponsive UI and animation hitches annoy users and degrade the user experience. Two measurements to track these types of experiences are slow frames and frozen frames. If you want your app to run smoothly, you should try to avoid both. The SDK adds these two measurements for the transactions you capture.

Slow and frozen frames are Mobile Vitals, which you can learn about in the [full documentation](/product/insights/mobile/mobile-vitals).

Learn more how to set it up in our [Slow and Frozen Frames Instrumentation](/platforms/flutter/integrations/slow-and-frozen-frames-instrumentation/) docs.
Learn more how to set it up in our [Slow and Frozen Frames Instrumentation](/platforms/dart/guides/flutter/integrations/slow-and-frozen-frames-instrumentation/) docs.

### AssetBundle Instrumentation

The [AssetBundle](https://api.flutter.dev/flutter/services/AssetBundle-class.html) instrumentation provides insight into how long your app takes to load its assets, such as files.

Learn more in our [AssetBundle Instrumentation](/platforms/flutter/integrations/asset-bundle-instrumentation/) docs.
Learn more in our [AssetBundle Instrumentation](/platforms/dart/guides/flutter/integrations/asset-bundle-instrumentation/) docs.

### File I/O Instrumentation

Expand All @@ -65,4 +65,4 @@ Learn more about our [file I/O integration](/platforms/dart/integrations/file/).

The sqflite database instrumentation provides the ability to track the performance of any sqflite query.

Learn more about our [sqflite Database Instrumentation](/platforms/flutter/integrations/sqflite-instrumentation/).
Learn more about our [sqflite Database Instrumentation](/platforms/dart/guides/flutter/integrations/sqflite-instrumentation/).
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ Please read the [Android developer documentation](https://developer.android.com/

## "Missing API declaration" after App Store review

Starting May 1, 2024, Apple requires all apps submitted to the App Store to provide a list of privacy-related APIs they use, including the reasons under which they use it. If you received an email from Apple with the message "ITMS-91053: Missing API declaration", your app doesn't fulfill the requirements. To solve this, follow our [Apple Privacy Manifest](/platforms/flutter/data-management/apple-privacy-manifest) guide.
Starting May 1, 2024, Apple requires all apps submitted to the App Store to provide a list of privacy-related APIs they use, including the reasons under which they use it. If you received an email from Apple with the message "ITMS-91053: Missing API declaration", your app doesn't fulfill the requirements. To solve this, follow our [Apple Privacy Manifest](/platforms/dart/guides/flutter/data-management/apple-privacy-manifest) guide.

## Known Limitations

- If you enable the `split-debug-info` and `obfuscate` features, you must upload [debug symbols](/platforms/flutter/upload-debug/).
- If you enable the `split-debug-info` and `obfuscate` features, you must upload [debug symbols](/platforms/dart/guides/flutter/upload-debug/).
- Issue titles might be obfuscated as we rely on the `runtimeType`, but they may not be human-readable. See the [Obfuscate Caveat](https://flutter.dev/docs/deployment/obfuscate#caveat).
- Layout related errors are only caught by [FlutterError.onError](https://api.flutter.dev/flutter/foundation/FlutterError/onError.html) in debug mode. In release mode, they are removed by the Flutter framework. See [Flutter build modes](https://flutter.dev/docs/testing/build-modes).
- Use [inbound filters](/concepts/data-management/filtering/) to exclude unhandled errors that are caught outside of your application in release builds. The SDK cannot filter these directly due to obfuscated stack traces.
Expand All @@ -39,19 +39,19 @@ flutter build apk --target-platform=android-arm --split-per-abi

## Native Symbolication on Android

The configuration for symbolication of Native events (C/C++) is documented in our [Android Native Development Kit](/platforms/android/configuration/using-ndk/) content. If you are having issues with symbolication in Flutter, check that your configuration is correct, as discussed in our Flutter content that covers [Uploading for Android NDK](/platforms/flutter/upload-debug/#uploading-for-android-ndk)
The configuration for symbolication of Native events (C/C++) is documented in our [Android Native Development Kit](/platforms/android/configuration/using-ndk/) content. If you are having issues with symbolication in Flutter, check that your configuration is correct, as discussed in our Flutter content that covers [Uploading for Android NDK](/platforms/dart/guides/flutter/upload-debug/#uploading-for-android-ndk)

## Native Symbolication on iOS/macOS

Flutter `split-debug-info` and `obfuscate` flags are supported on iOS/macOS. They require compiling your app using Flutter, version `3.7.0` and above and the Sentry Flutter SDK, version `6.10.0` and above.

## Source Context

Source Context support requires compiling your app using the `split-debug-info` build parameter on Flutter `3.10.0` and above. You must also upload [debug symbols](/platforms/flutter/upload-debug/) with the `upload_sources` option enabled.
Source Context support requires compiling your app using the `split-debug-info` build parameter on Flutter `3.10.0` and above. You must also upload [debug symbols](/platforms/dart/guides/flutter/upload-debug/) with the `upload_sources` option enabled.

## Sentry Dart Plugin

If you are using the Sentry Dart Plugin to upload [Debug Symbols](/platforms/flutter/upload-debug/#automatically-upload-debug-symbols), refer to the points below to resolve potential issues.
If you are using the Sentry Dart Plugin to upload [Debug Symbols](/platforms/dart/guides/flutter/upload-debug/#automatically-upload-debug-symbols), refer to the points below to resolve potential issues.

A Sentry `auth_token` can be generated at the [Organization Auth Tokens ](https://sentry.io/orgredirect/organizations/:orgslug/settings/auth-tokens/) settings page.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ See our docs on uploading [Debug Information Files](/cli/dif/#uploading-files) m

See our docs on uploading [Debug Information Files](/cli/dif/#uploading-files) manually with the Sentry CLI.

If you're using a version of `sentry_flutter` earlier than 5.1, native symbolication on Android requires a specific configuration. Refer to [Troubleshooting](/platforms/flutter/troubleshooting/#native-symbolication-on-android) for more information.
If you're using a version of `sentry_flutter` earlier than 5.1, native symbolication on Android requires a specific configuration. Refer to [Troubleshooting](/platforms/dart/guides/flutter/troubleshooting/#native-symbolication-on-android) for more information.

<Alert>

Expand Down Expand Up @@ -251,4 +251,4 @@ Alternative place to download sentry-cli. This is a `string` type with default v

## Troubleshooting

Refer to [Troubleshooting - Sentry Dart Plugin](/platforms/flutter/troubleshooting#sentry-dart-plugin) to resolve potential issues.
Refer to [Troubleshooting - Sentry Dart Plugin](/platforms/dart/guides/flutter/troubleshooting#sentry-dart-plugin) to resolve potential issues.
Loading
Loading