gpt4 book ai didi

android - Flutter - 我无法使用 Google 帐户登录

转载 作者:IT王子 更新时间:2023-10-29 07:04:37 24 4
gpt4 key购买 nike

当您点击该按钮时,会出现一个窗口,其中包含 Google 帐户选项,我选择了,但没有切换到新页面,而是出现错误。截图错误👇

我的代码:

import 'package:google_sign_in/google_sign_in.dart';

GoogleSignIn googleAuth = GoogleSignIn();
final FirebaseAuth _fAuth = FirebaseAuth.instance;
final GoogleSignIn _gSignIn = GoogleSignIn();

Future<FirebaseUser> _signInGoogle() async {
GoogleSignInAccount googleSignInAccount = await _gSignIn.signIn();
GoogleSignInAuthentication authentication = await googleSignInAccount.authentication;

var signInWithGoogle = signInWithGoogle;
FirebaseUser user = await _fAuth.signInWithGoogle(
idToken: authentication.idToken,
accessToken: authentication.accessToken
);
return user;
}


onPressed:() async {
await _signInGoogle();
Navigator.of(context).pushReplacementNamed('/home_screen');
}

enter image description here

enter image description here

enter image description here

最佳答案

您是否添加了 SHA 指纹?

请查看我对类似问题的回答,了解如何操作:https://stackoverflow.com/a/54479992/679553

关于android - Flutter - 我无法使用 Google 帐户登录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54469665/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com