trocarDeConta method

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

Sai da conta guardada, para entrar com outra.

Implementation

@override
Future<void> trocarDeConta() async {
  emit(state.copyWith(busy: true, limparErro: true));
  try {
    await store.signOut();
  } on AuthException catch (e) {
    if (!isClosed) emit(state.copyWith(error: e.message));
  } on Object catch (e) {
    if (!isClosed) {
      emit(state.copyWith(error: 'Não consegui falar com o servidor: $e'));
    }
  } finally {
    if (!isClosed) emit(state.copyWith(busy: false));
  }
}