RelatorioDoAlunoCubit constructor
Implementation
RelatorioDoAlunoCubit({
required this.remote,
required this.profUid,
required this.alunoUid,
required this.clock,
required this.guardadas,
this.recebimento,
}) : super(_estadoInicial(clock.now())) {
_assinatura = remote
.observarRotina(profUid: profUid, alunoUid: alunoUid)
.listen(
_aoChegarARotina,
onError: (Object _) => _aoChegarARotina(null),
);
// Quando o recebimento guarda rodadas (a série sobe), o dia visto é lido de novo.
_assinaturaDoLote = recebimento?.stream
.map((estado) => estado.serie)
.distinct()
.listen((_) => unawaited(_carregarRodadas()));
// O recebimento pede as rodadas do aluno; o que ele guardar chega pela série acima.
unawaited(recebimento?.receber([alunoUid]));
unawaited(_carregarSemana());
}