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

How to integrate go_router with seo_renderer? #21

Open
o7planning opened this issue Jun 4, 2022 · 2 comments
Open

How to integrate go_router with seo_renderer? #21

o7planning opened this issue Jun 4, 2022 · 2 comments

Comments

@o7planning
Copy link

Hello, I am using go_router for my project. Recently I wanted to integrate seo_renderer into my project.

https://pub.dev/packages/go_router

https://pub.dev/packages/seo_renderer

However, the examples show that these 2 libraries are not compatible with each other.

// seo_renderer:
runApp(
  RobotDetector(
    debug: true, // you can set true to enable robot mode
    child: MaterialApp(
      home: MyApp(),
      navigatorObservers: [seoRouteObserver],
    ),
  ),
);

// go_router
final _router = GoRouter(
  observers: [seoRouteObserver], // Not working.
  routes: [ ...]
);
// navigatorObservers is setted to null.
MaterialApp.router(
   routeInformationParser: _router.routeInformationParser,
   routerDelegate: _router.routerDelegate,
  title: 'GoRouter Example',
);

This my my question in stackoverflow:

https://stackoverflow.com/questions/72500928/how-to-integrate-go-router-with-seo-renderer

Hope to get an example from you.

@o7planning
Copy link
Author

I have successfully integrated your library into my project with "Go_Router". There doesn't seem to be any need for any changes. Although I don't know if "seoRouteObserver" is really needed with "Router" because without it everything works.

@krokyze
Copy link
Collaborator

krokyze commented Jun 12, 2022

I have successfully integrated your library into my project with "Go_Router". There doesn't seem to be any need for any changes. Although I don't know if "seoRouteObserver" is really needed with "Router" because without it everything works.

seoRouteObserver is mandatory or else the package will not remove previous page from html when you'll navigate to the next screen.

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