didPush method
Called when a route is pushed onto the navigator.
The route
parameter represents the route being pushed onto the navigator.
The previousRoute
parameter represents the route that was previously on top of the navigator.
Implementation
@override
void didPush(Route<dynamic> route, Route<dynamic>? previousRoute) {
WidgetsBinding.instance.addPostFrameCallback((_) {
final endTime = DateTime.now().millisecondsSinceEpoch;
final int duration = endTime - Tealeaf.startTime;
/// Calls Tealeaf plugin
PluginTealeaf.logScreenLayout(route.settings.name.toString());
tlLogger
.v('PluginTealeaf.logScreenLayout - Pushed ${route.settings.name}');
PluginTealeaf.logPerformanceEvent(
loadEventStart: 0,
loadEventEnd: duration,
);
});
}