Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firebase Analytics navigatorObservers on auto_route >= 1.0.0 #424

Closed
brizaldi opened this issue Mar 24, 2021 · 2 comments
Closed

Firebase Analytics navigatorObservers on auto_route >= 1.0.0 #424

brizaldi opened this issue Mar 24, 2021 · 2 comments

Comments

@brizaldi
Copy link

Hi,
From the firebase analytics documentation, to allow Tracking PageRoute Transitions we need to add a FirebaseAnalyticsObserver to the list of NavigatorObservers like this:

FirebaseAnalytics analytics = FirebaseAnalytics();

MaterialApp(
  home: MyAppHome(),
  navigatorObservers: [
    FirebaseAnalyticsObserver(analytics: analytics),
  ],
);

Is there a way to add this navigatorObservers because last time I check the current version of auto_route doesn't support it

@AlexanderFarkas
Copy link

AlexanderFarkas commented Mar 24, 2021

return MaterialApp.router(
      title: "My app",
      builder: (context, child) {
        return child;
      },
      theme: _getTheme(context),
      routerDelegate: _appRouter.delegate(
        navigatorObservers: []
      ),
      routeInformationParser: _appRouter.defaultRouteParser(),
    );

App router:
final _appRouter = AppRouter();

@brizaldi
Copy link
Author

Thank you @SashaFarkas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants