bugsnag_flutter 0.0.1+1 copy "bugsnag_flutter: ^0.0.1+1" to clipboard
bugsnag_flutter: ^0.0.1+1 copied to clipboard

outdated

Unofficial native bindings to the Bugsnag SDK. **Android support is still experimental**.

Bugsnag Flutter #

Unofficial native bindings to the Bugsnag SDK. Android is still experimental.

Setup #

void main() async {
  await Bugsnag.instance.configure(iosApiKey: 'YOUR_API_KEY', androidApiKey: 'YOUR_API_KEY', releaseStage: 'production');

  // Capture Flutter errors automatically:
  FlutterError.onError = Bugsnag.instance.recordFlutterError;

  runZonedGuarded(() {
    runApp(MyApp());
  }, (error, stackTrace) {
    Bugsnag.instance.recordError(error, stackTrace);
  });
}

⚠️ Because error reporting occurs in Flutter and not in the native code where Bugsnag expects to report the error from, the stack trace is recreated using Flutter's reports. The parsing can occaisionally drop full file paths, so a complete output of the errors thrown are reported to a custom "Flutter" tab on the Bugsnag report.

To better debug a crash, breadcrumbs can be transmitted to Bugsnag. Some are captured by default, but Flutter interactions are not. To track screens, use the built-in observer:

import 'package:bugsnag_flutter/bugsnag_observer.dart';

MaterialApp(
  // ...your material config...
  home: HomeScreen(),
  navigatorObservers: [
    BugsnagObserver(),
  ],
);

Or log specific events:

FlatButton(
  onTap: () {
    Bugsnag.instance.leaveBreadcrumb('Button Tapped', type: BugsnagBreadcrumb.user);
  }
);
9
likes
40
pub points
92%
popularity

Publisher

verified publisherbugsnag.com

Unofficial native bindings to the Bugsnag SDK. **Android support is still experimental**.

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

flutter, meta

More

Packages that depend on bugsnag_flutter