diff --git a/android/app/build.gradle b/android/app/build.gradle index 556b53a7..389aaa2e 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -81,7 +81,11 @@ dependencies { testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test.ext:junit:1.1.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' - implementation 'com.google.firebase:firebase-core:16.0.1' + // Cf. https://firebase.google.com/docs/android/setup#add-sdks. + implementation 'com.google.firebase:firebase-analytics:17.2.1' + implementation 'com.google.firebase:firebase-auth:19.1.0' + implementation 'com.google.firebase:firebase-firestore:21.2.1' + // Cf. https://pub.dev/packages/firebase_ml_vision api 'com.google.firebase:firebase-ml-vision-image-label-model:17.0.2' } diff --git a/android/build.gradle b/android/build.gradle index 264125da..7f77e24e 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -5,8 +5,8 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.2.1' - classpath 'com.google.gms:google-services:4.0.1' + classpath 'com.android.tools.build:gradle:3.5.2' + classpath 'com.google.gms:google-services:4.3.2' } } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 62fdcaa7..80ae2898 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip diff --git a/lib/routes/firebase_login_ex.dart b/lib/routes/firebase_login_ex.dart index f42820a1..75a06e15 100644 --- a/lib/routes/firebase_login_ex.dart +++ b/lib/routes/firebase_login_ex.dart @@ -95,7 +95,7 @@ class _FirebaseLoginExampleState extends State { idToken: googleAuth.idToken, ); // Note: user.providerData[0].photoUrl == googleUser.photoUrl. - final user = await kFirebaseAuth.signInWithCredential(credential); + final user = (await kFirebaseAuth.signInWithCredential(credential)).user; kFirebaseAnalytics.logLogin(); setState(() => this._user = user); return user; @@ -108,7 +108,7 @@ class _FirebaseLoginExampleState extends State { return curUser; } kFirebaseAuth.signOut(); - final anonyUser = await kFirebaseAuth.signInAnonymously(); // final + final anonyUser = (await kFirebaseAuth.signInAnonymously()).user; final userInfo = UserUpdateInfo(); userInfo.displayName = '${anonyUser.uid.substring(0, 5)}_Guest'; await anonyUser.updateProfile(userInfo); @@ -160,12 +160,10 @@ class _FirebaseLoginExampleState extends State { ), ), ListTile( - title: Text( - 'Last sign in: ${DateTime.fromMillisecondsSinceEpoch(user.metadata.lastSignInTimestamp)}'), + title: Text('Last sign in: ${user.metadata.lastSignInTime}'), ), ListTile( - title: Text( - 'Creation time: ${DateTime.fromMillisecondsSinceEpoch(user.metadata.creationTimestamp)}'), + title: Text('Creation time: ${user.metadata.creationTime}'), ), ListTile(title: Text('ProviderData: ${user.providerData}')), ], diff --git a/pubspec.yaml b/pubspec.yaml index 1dcb01af..4530e8ea 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -14,13 +14,14 @@ dependencies: async: '^2.2.0' backdrop: '0.1.8' cached_network_image: '1.1.2+1' - cloud_firestore: '0.12.6' + cloud_firestore: '0.12.9+6' english_words: '3.1.5' firebase_analytics: '3.0.3' - firebase_auth: '0.11.1+7' - firebase_database: '3.0.3' - firebase_ml_vision: '0.9.0+3' - firebase_storage: '3.0.2' + firebase_auth: '0.14.0+5' + firebase_core: '0.4.0+9' + firebase_database: '3.0.7' + firebase_ml_vision: '0.9.3' + firebase_storage: '3.0.6' flutter_bloc: '0.18.3' flutter_gallery_assets: '0.1.9+2' flutter_markdown: '0.2.0'