For Android

To Register your Flutter App to Firebase, you need to follow the following steps:

  1. Sign into Firebase using your Google account.

  2. Create a Firebase project by clicking on Add project in the Firebase console and then entering a Project Name(e.g. flutterstarter).

  3. To add an Android app, click the icon to launch the setup workflow. Enter com.flutterstarter.app in Android package name field.

  4. Click Download google-services.json to obtain your Firebase Android config file(google-services.json).

  5. Move your config file into the android/app directory of your Flutter app.

  6. To enable Firebase services in your Android app, add the google-services plugin to your Gradle files, as follows:

    1. In your root-level (project-level) Gradle file(app/android/build.gradle):
    buildscript {
    repositories {
    // Check that you have the following line (if not, add it):
    google() // Google's Maven repository
    }
    // ...
    dependencies {
    // ...
    // Add the following line:
    classpath 'com.google.gms:google-services:4.3.4' // Google Services plugin
    }
    }
    allprojects {
    // ...
    repositories {
    // Check that you have following line (if not, add it):
    google() // Google's Maven repository
    // ...
    }
    }
    1. In your module (app-level) Gradle file (usually app/android/app/build.gradle), apply the Google Services Gradle plugin.
    // Add the following line:
    apply plugin: 'com.google.gms.google-services' // Google Services plugin
    android {
    // ...
    }
    // ...
  7. Add Flutter plugins in pubspec.yaml file.

dependencies:
flutter:
sdk: flutter
//Add plugins here
cloud_firestore: ^0.12.9
firebase_core: ^0.4.0+8
  1. Run flutter packages get and you are good to go.