getNavigatorObserver method
Returns the navigator observer from the active analytics provider, or null if analytics is not registered or not ready.
This allows the main app to add the observer to its navigator without knowing which provider is active.
Safe to call from within the appRunner callback since it relies
on core.isRegistered rather than _isInitialised.
Implementation
Future<NavigatorObserver?> getNavigatorObserver() async {
if (core.isRegistered<AnalyticsService>()) {
final analyticsService = core.get<AnalyticsService>();
return await analyticsService.getAnalyticsObserver();
}
return null;
}