-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Closed
flutter/plugins
#1924Closed
Copy link
Labels
p: firebase_authThe Firebase Auth pluginThe Firebase Auth pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.
Description
The below example is listed in the firebase_auth plugin page on pub.dev:
https://pub.dev/packages/firebase_auth
Future<FirebaseUser> _handleSignIn() async {
final GoogleSignInAccount googleUser = await _googleSignIn.signIn();
final GoogleSignInAuthentication googleAuth = await googleUser.authentication;
final AuthCredential credential = GoogleAuthProvider.getCredential(
accessToken: googleAuth.accessToken,
idToken: googleAuth.idToken,
);
final FirebaseUser user = await _auth.signInWithCredential(credential);
print("signed in " + user.displayName);
return user;
}
The function "signInWithCredential" returns an AuthResult, which is not the same type as user (FirebaseUser). It should look something like this I think:
final FirebaseUser user = (await _auth.signInWithCredential(credential)).user;
Metadata
Metadata
Assignees
Labels
p: firebase_authThe Firebase Auth pluginThe Firebase Auth pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.