Today we are attending to set up firebase for flutter application, also talk about numerous things about firebase and flutter. We are already discussing that what is firebase. In this web journal, we are going to learn how to do Firebase Setup for Flutter Project. Let's begin it.
Now we are going to learn step by step. You'll be able effectively to interface with firebase by taking after us, these are exceptionally simple.
Firebase Setup for Flutter Project
- Go to Official website of firebase.
Go on Official website https://console.firebase.google.com/ and click on Get Start button.
- Create Project
Once you login on flutter at that point there will be an option of Create Project. Just press on and move to next.
- Enter nick name of your project
- Enable Google Analytics For Firebase project (optional )
Google Analytics is a moreover Google Tool which helps for Analysis information on your project like how numerous clients live on your project, how numerous time active on the app, which nation client visit your app and many more things. It's a choice you'll be able to enable latterly. Now you'll be able to skip it. After clicking on the Continue button, your application will be created.
- Select Android project on Firebase dashboard
After following all the previous steps now you're on the firebase dashboard. We are working for android so select android. After clicking on android, we need application id( it'll get from the application, for this underneath steps we'll make a application after proceed from step 8).
- Create Android Project
Now we need this firebase application to our android app, for this just create a app and configure for firebase. In my case the app name is flutterdemoapp.
- Copy Application ID fron gradle file
Now keep consider, we have two gradle files so please do not confuse, first gradle file path is
app/build.gradle
and the second isandroid\build.gradle
. Here you get application ID fromapp/build.gradle
file. - Paste Application in firebase application
- Download google-services.json file
Complete above step 8, you need to Download google-services.json file and move to app directory of your project.
- Add dependencies in android\build.gradle
follow below image
- Add plugin in app\build.gradle file
These dependencies and plugin will get on firebase like step 10. It's just copy paste work. After this step you need to save the file for this click on
file>Save All
option. - Run Application
After following all steps you need to run your application, also one more thing is that your internet should be connected with your mobile and laptop both. After a few seconds, a message will show on your screen like the below images. Congratulation you've successfully added Firebase to your app.
Bravo! we have successfully connected firebase to our app using the above steps. Thanks for read this article, if you have any query regarding this article then please ask in comment section.
ConversionConversion EmoticonEmoticon