Skip to content

Commit

Permalink
Add app flavor to flutter_context (#1799)
Browse files Browse the repository at this point in the history
* Add app flavor

* fix changelog
  • Loading branch information
ueman authored Jan 3, 2024
1 parent 404d19f commit bde5f6b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- Add `ConnectivityIntegration` for web ([#1765](https://github.com/getsentry/sentry-dart/pull/1765))
- We only get the info if online/offline on web platform. The added breadcrumb is set to either `wifi` or `none`.
- APM for isar ([#1726](https://github.com/getsentry/sentry-dart/pull/1726))
- Starting with Flutter 3.16, Sentry adds the [`appFlavor`](https://api.flutter.dev/flutter/services/appFlavor-constant.html) to the `flutter_context` ([#1799](https://github.com/getsentry/sentry-dart/pull/1799))

## 7.14.0

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!,
};
}

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;

0 comments on commit bde5f6b

Please sign in to comment.