Publish Flutter Web-app to Firebase is very easy and efficient. So, let me tell you in detail how can you publish your flutter Web-app to firebase Hosting.
Go to Google Firebase Console
You can find google Firebase Console here.
After logging in to the console. You will something like below image.
Create your project on Firebase Console
You can use your existing project or create a new project by clicking on “Add Project” button in google firebase console.
Setup Firebase Command Line Tools on your PC
Now, when you have your project created in your Google Firebase Console. Enable Firebase hosting for your project. Now, you need to set up firebase command-line tools in your device to publish your web app to firebase. To set up firebase command-line tools – you need to follow steps according to your operating system.
You can find the detailed steps here.
While writing this article I am using Microsoft Windows 10 so I have made my setup accordingly.
Fore Windows you can just download “node.js”. Firebase command line tools comes bundled with this.
You can download node.js installation binary from here.
If you have just downloaded the node js binary and installed it then don’t think everything is done.
Follow these steps also
Open CMD or Terminal Now and run the below command –
npm install -g firebase-tools// This command will install firebase command line tools globally on your device.
After successfull installation, run firebase command in command prompt or terminal. You will see screen like this.
Guys, If you have any questions please go to the comment section below this article and let me know.
You are 🆓 to comment.Please subscribe our youtube channel by clicking here to see interesting videos.
Login To Firebase Command Line Tools
When you have setup firebase command line tools. Run below command in cmd or terminal.
firebase login After running this command login to your firebase command.
After successfull login, you will see the below screen.
Go to root of your project folder and run below command.
This command will initialize the firebase project.
Select Hosting when the wizard asks for the feature to be used
Actually, a wizard will run in command prompt which will ask you multiple questions. You can select according to your use case.
In this step, select “use an existing project”
Here, as we have already created our project in google firebase console. So, I am selecting “use and existing project”.
Choose build/web as a directory & configure as a single-page app
As flutter by default builds your webs application in build/web directory so, I am chosing this directory.
Finally, Publish Flutter Web-app to Firebase Hosting.
Run this command to deploy your web app to firebase hosting.
If you or your friend have some project idea and want to hire some company to develop a mobile app or website for them. Please click here to get it done with us.
Follow us on Facebook
Subscribe our youtube channel.