简体   繁体   English

为什么 GoogleSignInAccount 会出现此错误?

[英]why this error occurred with GoogleSignInAccount?

I'm trying to use Google Sign In Account In but I have error this my code我正在尝试使用 Google 登录帐户,但我的代码出错了

class AuthViewModel extends GetxController{
  GoogleSignIn _googleSignIn = GoogleSignIn(scopes: ['email']);
  FirebaseAuth _auth = FirebaseAuth.instance;
  @override
  void onInit() {
    // TODO: implement onInit
    super.onInit();
  }
  @override
  void onReady() {
    // TODO: implement onReady
    super.onReady();
  }
  @override
  void onClose() {
    // TODO: implement onClose
    super.onClose();
  }
  void googleSignInMethod()async{
    final GoogleSignInAccount googleUser = await _googleSignIn.signIn();
}
}

and this is the error:这是错误:

error: A value of type 'GoogleSignInAccount?' can't be assigned to a variable of type 'GoogleSignInAccount'. (invalid_assignment at [ecommerce_app_getx_mvvm] lib\core\viewmodel\auth_view_model.dart:24)

错误图像

in the last version the problem appear so I used this version google_sign_in: ^5.0.3在上一个版本中出现了问题,所以我使用了这个版本 google_sign_in: ^5.0.3

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 GoogleSignInAccount.getIdToken()引发空对象引用错误 - GoogleSignInAccount.getIdToken() throws a null object reference error 为什么GetDownloadUrlAsync()返回'发生未知错误' - Why does GetDownloadUrlAsync() return 'An unknown error occurred' 错误:flutter/lib/ui/ui_dart_state.cc(166),未处理的异常:无效参数:“GoogleSignInAccount”实例 - ERROR:flutter/lib/ui/ui_dart_state.cc(166), Unhandled Exception: Invalid argument: Instance of 'GoogleSignInAccount' GoogleSignInAccount getIdToken() 为空 - GoogleSignInAccount getIdToken() is null FirebaseError:发生内部错误 - FirebaseError: An internal error occurred 类型不匹配:推断的类型是 GoogleSignInAccount? 但需要 GoogleSignInAccount > Task :app:buildInfoGeneratorFdroidDebug - Type mismatch: inferred type is GoogleSignInAccount? but GoogleSignInAccount was expected > Task :app:buildInfoGeneratorFdroidDebug FirebaseUser和GoogleSignInAccount有什么区别? - What are the differences between FirebaseUser and GoogleSignInAccount? 访问钥匙串时出错 - An error occurred when accessing the keychain “访问钥匙串时发生错误” - "An error occurred when accessing the keychain" Firebase:发生未知服务器错误 - Firebase : Unknown server error occurred
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM