Saturday, May 16, 2020

How configure firestore with your flutter application ?


Step 1 -  Go to https://console.firebase.google.com/ 

Step 2 - Click on add project



Step 3 - Click add Firebase to your Android app



Step 4 - fill the android package name and click register



Step 5 - Download config file & put it inside '\android\app'



Step 6 - Go to '\android' location and open 'build.gradle' add this line inside the dependencies

classpath 'com.google.gms:google-services:4.3.3'

 
Step 7 - Get into app 'build.gradle' and go to end 

If this line is already there do not add again.

add this line apply plugin: 'com.android.application'

apply plugin: 'com.google.gms.google-services'
 
Inside the dependencies

dependencies {
  implementation 'com.google.firebase:firebase-analytics:17.2.2'
}

Step 8 - go to pubspec.yaml

add this below dependency
 cloud_firestore^0.13.5 





Note - If you face any problem, Try this Open project/app/build.gradle and add the following lines.

defaultConfig {
    ...

    multiDexEnabled true
}

and

dependencies {
    ...

    implementation 'com.android.support:multidex:1.0.3' 
} 

No comments:

Post a Comment

How to make your app responsive according to screen size in Flutter

Step 1 : You can use below code to take your screen width & height      double  width =  MediaQuery . of (context).size.width;      doub...