rbc 99
rbc 99

Reputation: 26

How can I host my flutter web with firebase

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:Result 1.firebase init hosting 2.firebase deploy --only hosting

The structure of my proyect is:Struture And i want the page to go to main.dart

Upvotes: 0

Views: 1281

Answers (3)

rbc 99
rbc 99

Reputation: 26

The problem was that i have "estilos" y "responsive" in the same place as main.dart. This is the structure after the change

Upvotes: 0

Sathi Aiswarya
Sathi Aiswarya

Reputation: 2905

It is discussed in this github thread

change your firebase.json config slightly. You currently have the public directory set to build but if you look in there, the >index.htmlis the file you're seeing with the "Firebase Hosting Complete" message. When you build your app, it is actually being put into build/your-app-name so you'll need to change the line in firebase.json from:

"public": "build",

to:

"public": "build/your-app-name",

Also check above github and these similar cases for more alternate solutions:

Upvotes: 0

Tasnuva Tavasum oshin
Tasnuva Tavasum oshin

Reputation: 4740

Open Terminal then write :

firebase init hosting

then

flutter build web

then

firebase deploy --only hosting

for more details you can read this article

Upvotes: 2

Related Questions