ResumoPublisher constructor
Implementation
ResumoPublisher({
required this.clock,
required this.log,
required this.meta,
required this.currentUid,
required this.remote,
this.currentApelido,
Duration syncEvery = const Duration(minutes: 5),
}) {
_sobreOsMinutos = log.stream.listen((_) => sync());
_sobreAMeta = meta.stream.listen((_) => sync());
WidgetsBinding.instance.addObserver(this);
_timer = clock.periodic(syncEvery, (_) => sync());
unawaited(
Future.wait([log.leituraOk, meta.leituraOk]).then((leituras) {
if (!leituras.every((ok) => ok)) return;
_lido = true;
sync();
}),
);
}