Follow the below steps:
- Trigger the Google Authentication flow.
final GoogleSignInAccount googleUser = await GoogleSignIn().signIn();
- Obtain the auth details from the request.
final GoogleSignInAuthentication googleAuth = await googleUser.authentication;
final GoogleAuthCredential googleCredential = GoogleAuthProvider.credential(
accessToken: googleAuth.accessToken,
idToken: googleAuth.idToken,
);
- Sign in to Firebase with the Google [UserCredential]
final UserCredential googleUserCredential =
await FirebaseAuth.instance.signInWithCredential(googleCredential);
That's it !!
signInWithCredential()
. Until that call they may have signed in with Google, but they have not signed in to Firebase. – Frank van Puffelen