Integrate Flutter with Firebase

Flutter and Firebase

In this tutorial, i want to show you how to integrate your android Flutter apps with Firebase

  1. Create your own Flutter project, you can named it as what you want

2. Import Firebase core library in

copy “ firebase_core “ the latest version into pubsec.yaml on your project flutter below the “ cupertino_icon ”

dont forget to click pub get in the top right of android studio or you can type in terminal “ flutter pub get “

3. Open Firebase website ( )

click start

create your new project, name firebase up to as what you want, leave the google analytic open, click continue and then in the google analytic configuration, you can select default account for Firebase

and then create project, after that, wait until your project succesfully created.

4. Set up your android sdk to flutter

in your home of firebase website, you can select android logo, next to iOS logo

for package name, you can search in your flutter project, the file located in <yourproject>/android/app/build.gradle . within the build.gradle search for “ applicationId “ and copy it into package name in firebase.

your project package name

for the name of application, you can type whatever you want, and for SHA- leave it empty

click your register application and then download google-services.json file

put your “ google-services.json “ file into <yourproject>/android/app

click next, and add copy classpath from next step into <yourproject>/android/build.gradle

and then copy this following line below into <yourproject>/android/app/build.gradle

change minimal sdk version from 16 to 21

go back to firebase and then click continue, and then go to console

and yeah you already set up firebase to android sdk. now you must initialized firebase in flutter

go to “ main.dart “ file and change this



Thankyou, if there is a thing that might go wrong, just leave it in comment and i will fix it as soon as possible