Might be late but It may help somebody
In your flutter project
Delete web platform folder
open command prompt and run
flutter create . --platforms web
this will create web folder again run
again build for web
flutter build web
to run web app locally you need to install lite-server run
npm install -g lite-server
after successful install from your project directory run
cd build/web && lite-server
It will run you web app locally on your machine
So before deploying to the firebase hosting do some more changes in firebase.json
and index.html
file.
for more help refer article
After that in your project directory do the changes in file firebase.json
:
"hosting": {
"site" : "statepcs3",
"public": "build/web",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"headers": [
{
"source": "**",
"headers": [
{
"key": "Cache-Control",
"value": "no-cache"
}
]
}
]
}