signInWithGoogle method

Future<void> signInWithGoogle()

Implementation

Future<void> signInWithGoogle() async {
  print('[ArcaneAuth] signInWithGoogle called');
  _updateState(const AuthState.loading());
  try {
    verbose('Signing in with Google...');
    print('[ArcaneAuth] Creating Google provider...');
    final _GoogleAuthProvider provider = _GoogleAuthProvider();
    print('[ArcaneAuth] Calling signInWithPopup...');
    await _firebase.auth().signInWithPopup(provider).toDart;
    print('[ArcaneAuth] signInWithPopup completed');
  } catch (e) {
    print('[ArcaneAuth] Google sign-in error: $e');
    error('Google sign-in failed: $e');
    _updateState(AuthState.withError(_parseFirebaseError(e)));
  }
}