Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Add app flavor
  • Loading branch information
ueman committed Jan 1, 2024
commit e7f8216c9e97c155f547e4f975bc53b5d2a30109
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
- Breadcrumbs for database operations ([#1656](https://github.com/getsentry/sentry-dart/pull/1656))
- APM for hive ([#1672](https://github.com/getsentry/sentry-dart/pull/1672))
- Add `attachScreenshotOnlyWhenResumed` to options ([#1700](https://github.com/getsentry/sentry-dart/pull/1700))
- Starting with Flutter 3.16, Sentry adds the [`appFlavor`](https://api.flutter.dev/flutter/services/appFlavor-constant.html) to the `flutter_context` ([#1700](https://github.com/getsentry/sentry-dart/pull/1700))

### Dependencies

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ class FlutterEnricherEventProcessor implements EventProcessor {
// See https://github.com/flutter/flutter/issues/83919
// 'window_is_visible': _window.viewConfiguration.visible,
if (renderer != null) 'renderer': renderer,
if (_appFlavor != null) 'appFlavor': _appFlavor!,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think this can be tested without an integration test with a flavor set up. I'm really not sure whether that's worth the effort though.

Copy link
Contributor

Choose a reason for hiding this comment

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

That's fine for me, could also be done separately when someone has the chance

};
}

Expand Down Expand Up @@ -266,3 +267,10 @@ class FlutterEnricherEventProcessor implements EventProcessor {
return null;
}
}

/// Copied from https://api.flutter.dev/flutter/services/appFlavor-constant.html
/// As soon as Flutter 3.16 is the minimal supported version of Sentry, this
/// can be replaced with the property from the link above.
const String? _appFlavor = String.fromEnvironment('FLUTTER_APP_FLAVOR') != ''
? String.fromEnvironment('FLUTTER_APP_FLAVOR')
: null;