BugsnagNavigatorObserver constructor

BugsnagNavigatorObserver({
  1. bool leaveBreadcrumbs = true,
  2. bool setContext = true,
  3. String? navigatorName,
})

Create and configure a BugsnagNavigatorObserver to listen for navigation events and leave breadcrumbs and/or set the context.

If the navigatorName is null then the breadcrumbs will be suffixed with "navigator" resulting in breadcrumbs such as Route pushed on navigator, Route replaced on navigator and Route removed from navigator.

Typically you will configure this in you MaterialApp, CupertinoApp or Navigator:

return MaterialApp(
  navigatorObservers: [BugsnagNavigatorObserver()],
  initialRoute: '/',
  routes: {
    '/': (context) => const AppHomeWidget(),

Implementation

BugsnagNavigatorObserver({
  this.leaveBreadcrumbs = true,
  this.setContext = true,
  String? navigatorName,
}) : _navigatorName = (navigatorName != null) ? navigatorName : 'navigator';