You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
lib/loginpage.dart:110:57: Error: The method 'signInWithGoogle' isn't defined for the class 'firebase_auth::FirebaseAuth'.
Try correcting the name to the name of an existing method, or defining a method named 'signInWithGoogle'.
FirebaseAuth.instance.signInWithGoogle
Changing the code on line 109:
// From
FirebaseAuth.instance.signInWithGoogle(idToken: googleuser.idToken, accessToken: googleuser.accessToken).
// To
FirebaseAuth.instance.signInWithCustomToken(token: googleuser.idToken).
Allows the app to compile, but not sure if this the desired alternative and have yet to test on a device.
But now its again changed and the code will have an additional step, instead of the Firebase user, we get AuthResults, we have to extract the FirebaseUser from that
final AuthCredential credential = GoogleAuthProvider.getCredential( accessToken: googleAuth.accessToken, idToken: googleAuth.idToken, ); AuthResult authResults = await _auth.signInWithCredential(credential); FirebaseUser user = authResults.user;
Activity
ginuxone commentedon May 4, 2019
Following the firebase_auth you should be using
Instead of:
Batzee commentedon Apr 18, 2020
But now its again changed and the code will have an additional step, instead of the Firebase user, we get AuthResults, we have to extract the FirebaseUser from that
final AuthCredential credential = GoogleAuthProvider.getCredential( accessToken: googleAuth.accessToken, idToken: googleAuth.idToken, ); AuthResult authResults = await _auth.signInWithCredential(credential); FirebaseUser user = authResults.user;