How to use deep link in flutter web using navigator 2.0 on my webserver?

1,267

Solution 1

The problem because removed hash(#) in url

I was follow this How to remove hashtag (#) from url in web flutter but this is cause that problem When I back to original url(include hash), problem solved.

Solution 2

Please have a look at this code sample that uses new MaterialApp.router() constructor to handle url path.

In the parseRouteInformation of the RouteInformationParser you get the raw url and it's up to you how are you going to interpret the data. For instance, in the above sample the route is converted to object TheAppPath and later handled by RoutePageManager and RouterDelegate.

Share:
1,267
Taz
Author by

Taz

Hi i'm developer :)

Updated on December 26, 2022

Comments

  • Taz
    Taz over 1 year

    I can refresh(reload) and deep link when I launch debug in IDE(vscode) However when I published to own webserver(I made web resource from this command 'flutter web build'), My webserver is intercept my url and return 404.. :( It can enter from main page only

    Webserver is runing on golang and Flutter web using navigator 2.0

    How can I solve this?

    I can't find reference of flutter navigator 2.0 in web. Please save my life

  • Taz
    Taz over 3 years
    I know that.. It's not my point but thank you for comment