entrar method

Future<void> entrar(
  1. SocialProvider provider
)

Entra com provider. Com um login em curso, outro não começa.

Implementation

Future<void> entrar(SocialProvider provider) async {
  if (isClosed || state.busy != null) return;
  emit(EntrarState(busy: provider));
  try {
    await store.signInWithProvider(provider);
  } on AuthException catch (e) {
    if (!isClosed) emit(state.copyWith(erro: e.message));
  } on Object catch (e) {
    if (!isClosed) emit(state.copyWith(erro: 'Não consegui entrar: $e'));
  } finally {
    if (!isClosed) emit(state.copyWith(semBusy: true));
  }
}