bugsnag_crashlytics 0.0.1 copy "bugsnag_crashlytics: ^0.0.1" to clipboard
bugsnag_crashlytics: ^0.0.1 copied to clipboard

discontinuedreplaced by: bugsnag_flutter
outdated

Flutter plugin for Bugsnag Crashlytics. It reports uncaught errors to the Bugsnag console.

bugsnag_crashlytics plugin #

A Flutter plugin to use the Bugsnag Crashlytics Service.

Usage #

Use the plugin #

Add the following imports to your Dart code:

import 'package:bugsnag_crashlytics/bugsnag_crashlytics.dart';

Setup Crashlytics:

void main() {
  
  // pass your key api of bugsnag to the plugin to setup
  BugsnagCrashlytics.instance.register('3d587fd9c7907d4ad3d03b1d1fd10247');
  
  // Pass all uncaught errors from the framework to Crashlytics.
  FlutterError.onError = BugsnagCrashlytics.instance.recordFlutterError;
  
  runApp(MyApp());
}

Overriding FlutterError.onError with BugsnagCrashlytics.instance.recordFlutterError will automatically catch all errors that are thrown from within the Flutter framework.
If you want to catch errors that occur in runZoned, you can supply BugsnagCrashlytics.instance.recordError to the onError parameter:

runZoned<Future<void>>(() async {
    // ...
  }, onError: BugsnagCrashlytics.instance.recordError);

Result #

If an error is caught, you should see the following messages in your logs:

flutter: Flutter error caught by Crashlytics plugin:
// OR if you use recordError for runZoned:
flutter: Error caught by Crashlytics plugin <recordError>:
// Exception, context, information, and stack trace in debug mode
// OR if not in debug mode:
flutter: Error reported to Crashlytics.

Note: It may take awhile (up to 24 hours) before you will be able to see the logs appear in your Bugsnag console.

7
likes
0
pub points
14%
popularity

Publisher

unverified uploader

Flutter plugin for Bugsnag Crashlytics. It reports uncaught errors to the Bugsnag console.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, stack_trace

More

Packages that depend on bugsnag_crashlytics