From 363d8602dbb1dba65f0062f29d23fc0056f8ed95 Mon Sep 17 00:00:00 2001 From: Eyram Hlorgbe Date: Mon, 7 Jul 2025 17:10:18 +0000 Subject: [PATCH] docs: Update Google signInWithGoogle method to match 7.xx API --- docs/auth/federated-auth.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/docs/auth/federated-auth.md b/docs/auth/federated-auth.md index 218634ac0960..943505bdc4ce 100644 --- a/docs/auth/federated-auth.md +++ b/docs/auth/federated-auth.md @@ -37,16 +37,13 @@ Ensure the "Google" sign-in provider is enabled on the [Firebase Console](https: Future signInWithGoogle() async { // Trigger the authentication flow - final GoogleSignInAccount? googleUser = await GoogleSignIn().signIn(); + final GoogleSignInAccount? googleUser = await GoogleSignIn.instance.authenticate(); // Obtain the auth details from the request - final GoogleSignInAuthentication? googleAuth = await googleUser?.authentication; + final GoogleSignInAuthentication googleAuth = googleUser.authentication; // Create a new credential - final credential = GoogleAuthProvider.credential( - accessToken: googleAuth?.accessToken, - idToken: googleAuth?.idToken, - ); + final credential = GoogleAuthProvider.credential(idToken: googleAuth.idToken); // Once signed in, return the UserCredential return await FirebaseAuth.instance.signInWithCredential(credential);