tentarDeNovo method

Future<void> tentarDeNovo()
inherited

Fala com o servidor para renovar a sessão. Se der certo, o portão abre o app sozinho.

Implementation

Future<void> tentarDeNovo() async {
  emit(state.copyWith(busy: true, limparErro: true));
  try {
    await store.refreshSession();
  } 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));
  }
}