i've try to host my flutter in firebase but it doesn't work.
I already follow the steps of the firebase web and the result is this: 1.firebase init hosting 2.firebase deploy --only hosting
The structure of my proyect is: And i want the page to go to main.dart
CodePudding user response:
Open Terminal then write :
firebase init hosting
then
flutter build web
then
firebase deploy --only hosting
for more details you can read this article
CodePudding user response:
It is discussed in this github thread
change your
firebase.json
config slightly. You currently have thepublic
directory set tobuild
but if you look in there, the >index.html
is the file you're seeing with the "Firebase Hosting Complete" message. When you build your app, it is actually being put intobuild/your-app-name
so you'll need to change the line infirebase.json
from:"public": "build",
to:
"public": "build/your-app-name",
Also check above github and these similar cases for more alternate solutions: