I created a SignInbutton in my login page for the "Sign in With Google" option, I connected it with firebase and everything is working properly but after I signed in with my Google mail-id the app is not directing to the home page and the mail-id is not getting added to the firebase authentication. I am getting a error like this:
[ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null, null) E/flutter (30143): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:597:7) E/flutter (30143): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:158:18) E/flutter (30143): E/flutter (30143): #2
MethodChannel.invokeMapMethod (package:flutter/src/services/platform_channel.dart:358:43) E/flutter (30143): E/flutter (30143): #3
GoogleSignIn._callMethod (package:google_sign_in/google_sign_in.dart:235:30) E/flutter (30143): E/flutter (30143): #4
GoogleSignIn.signIn.isCanceled (package:google_sign_in/google_sign_in.dart) E/flutter (30143):
this is the code i wrote
children: [
GestureDetector(
child: SignInButton(
Buttons.Google,
onPressed: () {
AuthClass()
.signWithGoogle()
.then((UserCredential value) {
final displayName = value.user!.displayName;
print(displayName);
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(
builder: (context) => HomePage()),
(route) => false);
});
},
text: 'Sign In with Google',
),