Skip to content

Commit

Permalink
fix X-Wei#27 (firestore crashing)
Browse files Browse the repository at this point in the history
Update firebase to latest deps solved the pb.
  • Loading branch information
X-Wei committed Nov 4, 2019
1 parent 5210e94 commit 894dc52
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 15 deletions.
6 changes: 5 additions & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

Expand Down
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
}

Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 4 additions & 6 deletions lib/routes/firebase_login_ex.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class _FirebaseLoginExampleState extends State<FirebaseLoginExample> {
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;
Expand All @@ -108,7 +108,7 @@ class _FirebaseLoginExampleState extends State<FirebaseLoginExample> {
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);
Expand Down Expand Up @@ -160,12 +160,10 @@ class _FirebaseLoginExampleState extends State<FirebaseLoginExample> {
),
),
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}')),
],
Expand Down
11 changes: 6 additions & 5 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 894dc52

Please sign in to comment.