- The configuration options
discardClasses
andredactedKeys
are nowRegExp
s instead of strings. This allows developers to have more control over how they perform.
bugsnag.start
accepts Set<RegExp>
for redactedKeys
and discardClasses
. To specify them use:
bugsnag.start(
// ...
redactedKeys: {
RegExp('password'),
RegExp('^[A-Fa-f0-9]{16}\$', multiLine: true)
},
discardClasses: {
RegExp('sec', caseSensitive: false),
},
// ...
);
## 2.x to 3.x
A minimum of Flutter version of 3.10.0 is now required.
### Key points
- Minimum Flutter version was bumped to 3.10.0
- `runApp` options have been removed from `start` and `attach`, instead simply `await bugsnag.start`
- `telemetry` has been made easier to control by replacing the `Set<BugsnagTelemetryType>` with a new `BugsnagTelemetryTypes`
### Starting Bugsnag
You no longer have to pass `runApp` when calling `start` and `attach`. The startup code is for a Flutter-first app is therefore:
```dart
Future<void> main() async {
await bugsnag.start(apiKey: 'your-api-key');
runApp(MyApplication());
}
or for a native-first app:
Future<void> main() async {
await bugsnag.attach(
// configuration here
);
runApp(MyApplication());
}
Telemetry options have been simplified into a new dedicated type instead of being a set. To specify custom telemetry options, use:
bugsnag.start(
// other options
telemetry: const BugsnagTelemetryTypes(/* telemetry options */),
);
Flutter is now officially supported by Bugsnag! Many thanks to the community for the previous library and for allowing us to take the bugsnag_flutter
package name.
To upgrade:
bugsnag_flutter/bugsnag.dart
is nowbugsnag_flutter/bugsnag_flutter.dart
- we recommend using single Flutter project rather than separate platform projects. To continue using existing separate projects, use ternaries like
Platform.isAndroid ? androidApiKey : iosApiKey
when usingbugsnag.start
.setUser
accepts a named ID instead of an unnamed ID in the first positionBugsnagObserver
is nowBugsnagNavigatorObserver
Bugsnag.instance
is now a globalbugsnag
Bugsnag.instance.recordError
is nowbugsnag.notify
Bugsnag.instance.recordFlutterError
should be translated asbugsnag.notify(error.exception, error.stack)
BugsnagBreadcrumb
is nowBreadcrumbType