carregar method

Future<void> carregar()

Lê o progresso guardado. Sem leitura, nada se grava.

Implementation

Future<void> carregar() async {
  try {
    final itens = await store.carregar();
    if (isClosed) return;
    emit(state.copyWith(itens: itens, lido: true, erro: false));
  } on Object catch (e) {
    DiagLog.log('erro', 'rotina: não consegui ler o progresso: $e');
    if (isClosed) return;
    emit(state.copyWith(erro: true, lido: false));
  }
}