How can I load a specific url page using Firebase Hosting for Flutter Web

Viewed 178

I'm using Getx for navigation which internally uses Navigator 2.0. I'm unable to load a specific URL when I Host in Firebase Hosting.

It seems to be working fine locally.

I'm using Url Path Strategy to remove the #

1 Answers

Check if you correctly rewrite all requests to /index.html

https://firebase.google.com/docs/hosting/full-config

firebase.json:

{
  "hosting": {
    "public": "www",
    "ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
    "rewrites": [
      {
        "source": "**",
        "destination": "/index.html"
      }
    ]
  },
    ...

Deploy again afterwards.

Related