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

Flutter web: Refreshing dynamic route opens blank page #276

Open
Schloool opened this issue Dec 6, 2022 · 1 comment
Open

Flutter web: Refreshing dynamic route opens blank page #276

Schloool opened this issue Dec 6, 2022 · 1 comment

Comments

@Schloool
Copy link

Schloool commented Dec 6, 2022

I encountered an issue while developing a Flutter Web App using the fluro routing system.
In the app it is possible to access an overview of plugins as well as a specific plugin detail page.
Therefore a fluro router is set up when starting the app:

void _setupRouter() {
  final router = FluroRouter();

  router.notFoundHandler = Handler(handlerFunc: (c, p) => NotFoundPage());
  router.define('/', handler: Handler(handlerFunc: (c, p) => LandingPage()));
  router.define('/plugins', handler: Handler(handlerFunc: (c, p) => const PluginStorageView()));
  var pluginHandler = Handler(handlerFunc: (c, p) => PluginDetailScreen(storageItemId: p['id']?.first ?? 'unknown'));
  router.define('/plugins/:id', handler: pluginHandler);

  App.router = router;
}

When clicking on an plugin in the overview screen, the detail page is opened using this statement:

App.router.navigateTo(context, '/plugins/${plugin.id}')

All of this works pretty fine opening a webpage looking like this:
image

However, when refreshing the page or opening the app at a specified dynamic route such as mywebsite.com/plugins/1234, the website is just white and not a single element of my Material app is loaded:
image

Is there any way I can access dynamic routes directly using an URL?

@lkrjangid1
Copy link

I have facing same issue. Did you get any solution of this problem.

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