Search code examples
htmlflutterurlflutter-web

why using the path URL strategy on my flutter web breaks my navigation?


Using hashes in social media share buttons is almost impossible, so I wanted to get rid of the # in my flutter web url path, the problem is that when I do that, my navigation that I set with onRoute breaks and can't find the webpage, I thought it was a surge problem but even when I deploy it on firebase configuring it to be a Single Page Application I have the same problem. I'm really struggling here.. I have no more ideas, do you?


Solution

  • Okay, I'm answering my own question to make the travel easier for future developers with the same question. Flutter path url strategies seem to break under subdomains, using websites like surge, Firebase hosting or netlify make your navigation stop working when you are using pathURlStrategy().

    Using a real domain fix the problem for me