无法更新设备上的文件:HttpException:在收到完整的标头之前,连接已关闭,uri = http://127.0.0.1:56719/jca0V7fmiW8=/

时间:2019-09-11 09:23:47

标签: flutter

我正在尝试通过我的Android应用使用Flutter与Google登录, 但是当我按下登录按钮时出现此错误。

final FirebaseAuth _auth = FirebaseAuth.instance;
  final GoogleSignIn _googleSignIn = new GoogleSignIn();
  Future<FirebaseUser> _handleSignIn() async {
    GoogleSignInAccount googleUser = await _googleSignIn.signIn();
    GoogleSignInAuthentication googleAuth = await googleUser.authentication;
    final AuthCredential credential = GoogleAuthProvider.getCredential(
      accessToken: googleAuth.accessToken,
      idToken: googleAuth.idToken,
    );
    final FirebaseUser user =
        (await _auth.signInWithCredential(credential)).user;
    print("signed in " + user.displayName);
    return user;
  }

我在这里调用此函数...

onPressed: () => _handleSignIn()
                      .then(
                        (FirebaseUser user) => print(user),
                      )
                      .catchError(
                        (e) => print(e),
                      )),

0 个答案:

没有答案