Advanced use cases

Find out about advanced ways to configure BugSnag in Flutter apps.

Detecting errors in other zones#

Often when spawning new zones you want any unhandled errors that occur to be reported to BugSnag. While you can do this manually with:

runZonedGuarded(
  () {
    // possibly crashy code
  },
  bugsnag.errorHandler,
);

BugSnag Flutter includes a small utility method to simplify this for you:

bugsnag.runZoned(() {
  // possibly crashy code
});