How to connect Firebase to our Flutter project

How to connect Firebase to our Flutter project

In this article i will teach you how we can connect Firebase to our Flutter project just follow all the steps given below.

First you have to create a firebase project for this click on a link given below.

https://console.firebase.google.com

Give the project name and press continue button

No alt text provided for this image

Press the continue button

No alt text provided for this image

Select the account and click on create project

No alt text provided for this image

Click on android icon

No alt text provided for this image

You get the following screen. Give the android Package name , app nickname , SHA-1 key. If you don't know how to get android package name and SHA-1 key don't worry guys. I will discuss it in this article.

No alt text provided for this image

For android package name open flutter project . In flutter project open AndroidManifest.xml. For AndroidManifest.xml follow the following path.

android/app/src/main/AndroidManifest.xml.

Open AndroidManifest.xml here you get package name.

No alt text provided for this image

Copy the package name and paste it on Android package name.



Now give the nickname anything you want. For SHA key open the terminal of Visual Studio Code and run the following command.


First you have to run the following command

cd android        

and then run the command given below

.\gradlew signingReport        

copy SHA-1 and SHA-256 key , paste SHA-1 key and click on Register app.


Now download the json file and paste it on the following path .

android/app/download json file past here

click on the next button.

No alt text provided for this image

Now add the following line in the dependencies project level build.gradel.

classpath 'com.google.gms:google-services:4.3.10'        
No alt text provided for this image

Now open App - level build.gradle and paste the following line.

apply plugin: 'com.google.gms.google-services'        

add the following lines also

multiDexEnabled?true

implementation?'com.android.support:multidex:1.0.3'        
No alt text provided for this image
No alt text provided for this image

Now the setup is complete, click on Next and after it click on Go to console. Add the following package.

firebase_core:any        

Now initialize the firebase in flutter like this

No alt text provided for this image

???? ?????? ???? ????????. ???? ?????? ?????????????? ??????? ??????????????. ??????'?? ???????????? ???? ?????????? ???????? ???????????? ?????? ???????? ????????? ??????? ???????? ??????????????. ???? ?????? ?????? ??????????? ?????? ??????????, ???????????? ?????????????? ???? ???? ??????????????.

https://www.dhirubhai.net/in/bhushan-jadhav-2688541b9

???????????.........






要查看或添加评论,请登录

Bhushan Jadhav的更多文章

  • Dart Extension

    Dart Extension

    Hello guys!! In this article you will learn how to use extension in dart. After reading this article you will be able…

    1 条评论
  • Generics in dart

    Generics in dart

    Hello! In this article, you’ll learn how to use the Dart generics. After reading this article you can easily use dart…

    2 条评论
  • Unit Test in Flutter

    Unit Test in Flutter

    Hello guys in this article we are going to learn how to write Unit test in Flutter . Unit test plays a very important…

  • How to use Native code in Flutter

    How to use Native code in Flutter

    Hello FlutterDevs, In this article we will learn, How we can use Native code in our Flutter Project for Android and i…

社区洞察

其他会员也浏览了