Flutter 如何使用预设的电子邮件和密码登录到google oauth?

Flutter 如何使用预设的电子邮件和密码登录到google oauth?,flutter,google-api,google-drive-api,google-oauth,google-authentication,Flutter,Google Api,Google Drive Api,Google Oauth,Google Authentication,我正在为客户开发一款颤振应用程序。 这涉及到将文件上载到Google drive文件夹 我已经让它与谷歌登录弹出窗口一起工作,但他们想要它,以便使用的帐户与设备帐户分开 这可能吗? 我认为服务帐户是不对的,因为他们仍然希望在应用程序设置中设置电子邮件和密码,而且据我所知,服务帐户需要在API控制台中直接创建和链接 编辑:这是我当前使用谷歌登录插件登录的代码 static final GoogleSignIn _googleSignIn = GoogleSignIn( scopes:

我正在为客户开发一款颤振应用程序。
这涉及到将文件上载到Google drive文件夹

我已经让它与谷歌登录弹出窗口一起工作,但他们想要它,以便使用的帐户与设备帐户分开

这可能吗?

我认为服务帐户是不对的,因为他们仍然希望在应用程序设置中设置电子邮件和密码,而且据我所知,服务帐户需要在API控制台中直接创建和链接

编辑:这是我当前使用谷歌登录插件登录的代码

 static final GoogleSignIn _googleSignIn = GoogleSignIn(
     scopes: [
       g.DriveApi.DriveScope,
       g.DriveApi.DriveMetadataReadonlyScope
     ]
   );
 static dynamic token;
 ...

static login() async{
    try {
      final GoogleSignInAccount googleUser = await _googleSignIn.signIn();
      final GoogleSignInAuthentication googleAuth = await googleUser
      .authentication;
      print("signed in " + googleAuth.accessToken);
      token = googleAuth.accessToken;
      _authHeaders = await _googleSignIn.currentUser.authHeaders;
    }catch(exception){
      //maybe offline
      print("login error: "+exception.toString());
    }
  }

那么,是否可以使用电子邮件和密码来代替此方法(显示一个帐户选择弹出窗口)?

能否提供您的代码以使您的问题更清楚?我已在编辑中添加了登录代码,谢谢。没有任何方法可以使用密码来验证对Google API的调用。尝试