


# signInWithGoogle method




    *[<Null safety>](https://dart.dev/null-safety)*




[FutureOr](https://api.flutter.dev/flutter/dart-async/FutureOr-class.html)&lt;void> signInWithGoogle
()





<p>Starts the Sign In with Google Flow.</p>
<p>Throws a SignInWithGoogleFailureInterface if an exception occurs.</p>



## Implementation

```dart
FutureOr<void> signInWithGoogle() async {
  if (state.status.isSubmissionInProgress) {
    return;
  }
  final form = formRepository.accessForm(formName);
  emit(SignInState(form: form, status: FormStatus.submissionInProgress));

  return CustomRoutine<Account, Data?>(
    routine: authenticationRepository.signInWithGoogle,
    attachedLogic: (routineResult) => onSignInWithGoogle(
      routineResult,
      form,
    ),
    onError: (error) {
      emit(
        SignInState(
          form: form,
          errorMessage: error.message,
          status: FormStatus.submissionFailure,
        ),
      );
      addError(error);
    },
    onSuccess: (account, data) {
      authenticationRepository.addSession(
        SessionWrapper(
          event: SignedInEvent(account: account),
          session: Session<Data>(
            account: account,
            data: data,
          ),
        ),
      );
      emit(
        SignInState(
          form: form,
          status: FormStatus.submissionSuccess,
        ),
      );
    },
  ).call();
}
```







