Flutter

Youtube ithinkdiff.net Twitter: @mahmudahsan

A flutter and firebase based vote application. For state management we used, Provider.

If you need to know how to use Provider, please - How to use Provider 3.0 - Migrating Provider 3 to 4

Demo 2.0

Firebase auth

Demo

Features and Updates

Version 3.0 1. Provider library updated to version 4.0 2. All other 3rd party libraries updated 3. All related app code updated to support provider 4.0 4. Android auth fix in firebase and in config

Version 2.0 1. User can sign in 2. User can see vote List from Firebase 3. User can vote 4. User can see result

### Authentication Flow Chart

authentication

### Migration to Provider 4 - Update Provider 3.0 to 4.0 - Changes committed

### Firebase configuration for android 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 from android/app/src/main/AndroidManifest.xml to get the application id
  • Download google-service.json file from firebase

Firebase auth

  • Copy google-service.json file and put it android/app/google-service.json
  • Update android/build.gradle by adding multiDexEnabled true to defaultConfig
    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 

Firebase auth

Widgets

Widget Index

3rd Party Libraries

Tutorials

  1. Youtube - Flutter Playlist 1
  2. Youtube - Flutter Playlist 2

Flutter Full Application

  1. Vote | Tutorial
  2. Todos | Tutorial

Flutter Tutorials Beginners

  1. Dart Programming Language for Beginners
  2. Flutter for Beginners - Creating First App
  3. How to Create a Profile Page App

Flutter Tutorials Managing States

  1. Stateful Widget
  2. State: Provider | Tutorial
  3. State: Redux | Tutorial
  4. State: Bloc | Tutorial

Flutter Mixed

Quick Reference

  1. Dart Language | Video
  2. Flutter | Video

Resources

Support

If it helps you, please give a star in this repo. Also you can support me by subscribing my youtube channel.

Questions or feedback?

Feel free to open an issue, or find me @mahmudahsan on Twitter.

FLUTTER-APPS DART FIREBASE FIREBASE-AUTH FIREBASE-DATABASE FLUTTER FLUTTER-APPS FLUTTER-DEMO FLUTTER-EXAMPLES PACKAGES
SHARE: