File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -42,12 +42,13 @@ class AppState extends State<App> {
42
42
try {
43
43
googleSignIn = GoogleSignIn ();
44
44
GoogleSignInAccount googleSignInAccount = await googleSignIn.signIn ();
45
- GoogleSignInAuthentication gauth =
46
- await googleSignInAccount.authentication;
47
- FirebaseUser user = await _auth.signInWithGoogle (
45
+ final GoogleSignInAuthentication gauth = await googleSignInAccount.authentication;
46
+ final AuthCredential credential = GoogleAuthProvider .getCredential (
48
47
accessToken: gauth.accessToken,
49
48
idToken: gauth.idToken,
50
49
);
50
+ final AuthResult authRes = await _auth.signInWithCredential (credential);
51
+ final FirebaseUser user = authRes.user;
51
52
52
53
setState (() {
53
54
_username = user.displayName;
You can’t perform that action at this time.
0 commit comments