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

onUnknownRoute not called with PathUrlStrategy #23

Closed
Tom3652 opened this issue Aug 18, 2021 · 4 comments
Closed

onUnknownRoute not called with PathUrlStrategy #23

Tom3652 opened this issue Aug 18, 2021 · 4 comments

Comments

@Tom3652
Copy link

Tom3652 commented Aug 18, 2021

Hello !

If i use the method setPathUrlStrategy(), the method onUnknownRoute() is not called anymore and it redirects me to the main page.
The error is for example :

Could not navigate to initial route.
The requested route name was: "/gfdjfc"
There was no corresponding route in the app, and therefore the initial route specified will be ignored and "/" will be used instead.

If i have the UrlPathStrategy it's working fine.
Thanks

@creativecreatorormaybenot
Copy link
Contributor

Hi @Tom3652 - thanks for using the package and opening the issue!

Unfortunately, none of the logic for the URL strategy is implemented in this package. The package only handles setting (activating) the URL strategy. All of the logic happens in https://github.com/flutter/flutter, so if you want to report an issue about the PathUrlStrategy, you will have to do so there.

@Tom3652
Copy link
Author

Tom3652 commented Aug 19, 2021

Hello !

Thanks for the reply, yes i will open an issue there then :)

@creativecreatorormaybenot
Copy link
Contributor

@Tom3652 👍 you can link it here for reference. I would love to help you, but truth is no matter what I change in the package, there is no way to fix it here.

@Tom3652
Copy link
Author

Tom3652 commented Aug 19, 2021

I have found the solution myself !
The problem was that i had a home property on my MaterialApp main Widget.
So all the wrong routes were redirected to this home instead of calling the onUnknownRoute.
Sorry for the issue then everything works fine with this strategy and the package, if it can help others :)

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

No branches or pull requests

2 participants