Untitled

mail@pastecode.io avatar
unknown
dart
a year ago
510 B
3
Indexable
Never
signWithGoogle() async {
    String? mail = "";

    final GoogleSignInAccount? gUser = await GoogleSignIn().signIn();
    final GoogleSignInAuthentication gAuth = await gUser!.authentication;
    final credential = GoogleAuthProvider.credential(
        accessToken: gAuth.accessToken, idToken: gAuth.idToken);
    await FirebaseAuth.instance.signInWithCredential(credential).then((value) {
      mail = value.user?.email;
      print(value.user);
      print(value.user?.email);
    });

    return mail;
  }