InstanaScreenNameObserver constructor
InstanaScreenNameObserver({
- BuildContext? buildContext = null,
- ScreenNameExtractor screenNameExtractor = defaultNameExtractor,
- RouteFilter routeFilter = defaultRouteFilter,
When the NavigatorObserver sends the events with the currently active ModalRoute changes (push/pop), Instana will extract the screen name from RouteSettings using ScreenNameExtractor.
You can customise the way in which the name should be extracted by providing a custom ScreenNameExtractor with the constructor. If the BuildContext is not provided with InstanaScreenNameObserver constructor, Instana will not try to extract names from the active Widget's name/ child/ child's title.
For usage, add it to the navigatorObservers
of your Navigator,
For Eg:
MaterialApp(
home: Home(),
navigatorObservers: [
InstanaScreenNameObserver(buildContext),
],
);
Implementation
InstanaScreenNameObserver({
this.buildContext = null,
this.screenNameExtractor = defaultNameExtractor,
this.routeFilter = defaultRouteFilter
});