signInWithGoogle method

  1. @override
Future<void> signInWithGoogle()
override

Implementation

@override
Future<void> signInWithGoogle() async {
  try {
    final GoogleSignInAccount? googleUser = await _googleSignIn.signIn();
    if (googleUser == null) {
       return;
    }
    final GoogleSignInAuthentication googleAuth =
    await googleUser.authentication;
    final OAuthCredential credential = GoogleAuthProvider.credential(
      accessToken: googleAuth.accessToken,
      idToken: googleAuth.idToken,
    );
    await _firebaseAuth.signInWithCredential(credential);
  } catch (e) {
    throw _mapFirebaseError(e);
  }
}