flutter_appcenter_bundle
flutter_appcenter_bundle copied to clipboard
Running app in error zone
Struggling to find much documentation on correct way of catching Flutter app errors.
Here's what I have:
void main() async {
runZonedGuarded<Future<void>>(() async {
FlutterError.onError =
(details) => AppCenter.trackErrorAsync(details.exceptionAsString());
WidgetsFlutterBinding.ensureInitialized();
await AppCenter.startAsync(
appSecretAndroid: 'xx',
appSecretIOS: 'xxx',
enableCrashes: true, // Defaults to true
);
runApp(App());
},
(error, stackTrace) =>
Zone.current.handleUncaughtError(error, stackTrace));
}
Here's relevant gist: https://gist.github.com/fredgrott/0e51f220fd27fa54f1b51d522a499902
https://github.com/flutter/flutter/issues/44407
Is any of the above necessary, or handled implicitly by configureCrashesAsync?