SimplyticsNavigatorObserver class

A NavigatorObserver that sends events to analytics service when the currently active ModalRoute changes.

To use it, add it to the navigatorObservers of your Navigator, e.g. if you're using a MaterialApp:

MaterialApp(
  home: MyAppHome(),
  navigatorObservers: [
    SimplyticsNavigatorObserver(),
  ],
);

You can configure the extraction of the route name from RouteSettings using the nameExtractor parameter, as well as filter transitions between which routes will be automatically sent to the analytics service using the routeFilter parameter.

Inheritance

Constructors

SimplyticsNavigatorObserver({ScreenNameExtractor nameExtractor = defaultNameExtractor, RouteFilter routeFilter = defaultRouteFilter, dynamic onError(PlatformException error)?})
Creates a NavigatorObserver that sends events to analytic service.

Properties

hashCode int
The hash code for this object.
no setterinherited
nameExtractor ScreenNameExtractor
A function that extracts a screen name from Route.settings.
final
The navigator that the observer is observing, if any.
no setterinherited
routeFilter RouteFilter
A function that allows you to filter out routes that should not be tracked.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

didPop(Route route, Route? previousRoute) → void
The Navigator popped route.
override
didPush(Route route, Route? previousRoute) → void
The Navigator pushed route.
override
didRemove(Route route, Route? previousRoute) → void
The Navigator removed route.
inherited
didReplace({Route? newRoute, Route? oldRoute}) → void
The Navigator replaced oldRoute with newRoute.
override
didStartUserGesture(Route route, Route? previousRoute) → void
The Navigator's routes are being moved by a user gesture.
inherited
didStopUserGesture() → void
User gesture is no longer controlling the Navigator.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited