Firebase Setup for Flutter Project

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

  1. Go to Official website of firebase.

    Go on Official website https://console.firebase.google.com/ and click on Get Start button.

  2. 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.

  3. Enter nick name of your project

  4. 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.


  5. 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).

  6. 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.

  7. 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 is android\build.gradle. Here you get application ID from app/build.gradle file.

  8. Paste Application in firebase application

  9. 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.

  10. Add dependencies in android\build.gradle

    follow below image

  11. 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.

  12. 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.

Previous
Next Post »