- Video Tutorial 1: Building the app
- Video Tutorial 2: Add Firebase Authentication and Firestore Database
- Video Tutorial 3: Migrating Provider 4.0 and Fix Android Firebase Authentication issues
A flutter and firebase based vote application. For state management we used, Provider.
If you need to know how to use Provider, please
Version 3.0
- Provider library updated to version 4.0
- All other 3rd party libraries updated
- All related app code updated to support provider 4.0
- Android auth fix in firebase and in config
Version 2.0
- User can sign in
- User can see vote List from Firebase
- User can vote
- User can see result
Sometimes firebase and google auth doesn't work on Android Emulators, so preferred way to to test in a real device
Firebase authentication is very critical for android. If you don't do the following things the app will not work on android. Also if you found any error, search in Google.
To know more about how to add Firebase Auth, Google Auth and Firestore in a Flutter app check the video tutorial
- Update all 3rd party libraries in pubspec.yaml
- Add android app in the firebase. To change or know the android application id open the file
android/app/build.gradle
or check fromandroid/app/src/main/AndroidManifest.xml
to get the application id - Download
google-service.json
file from firebase
- Copy
google-service.json
file and put itandroid/app/google-service.json
- Update
android/build.gradle
by addingmultiDexEnabled true
todefaultConfig
defaultConfig {
multiDexEnabled true
}
- Update
android/gradle.properties
if you already didn't migrated https://flutter.dev/docs/development/androidx-migration
android.useAndroidX=true
android.enableJetifier=true
- update android/build.gradle to latest versions
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
classpath 'com.google.gms:google-services:4.3.3'
}
- Update distributionUrl to latest
android/gradle/wrapper/gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
- Android Google Sign In. Run the following command generate SHA-1 and SHA-256 keys and add in Firebase https://stackoverflow.com/questions/15727912/sha-1-fingerprint-of-keystore-certificate
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
- Dart Programming Language for Beginners
- Flutter for Beginners - Creating First App
- How to Create a Profile Page App
If it helps you, please give a star in this repo. Also you can support me by subscribing my youtube channel.
Feel free to open an issue, or find me @mahmudahsan on Twitter.