We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
late Timer _timer; bool _timerAtivo = true;
@OverRide void initState() { super.initState();
statusUpdate(); _timer = Timer.periodic(const Duration(seconds: 1), (timer) { if (_timerAtivo) { iniciarTemporizadorPegarStatus(); } });
}
String statusParametros = '';
Future statusUpdate() async { Future.delayed(const Duration(seconds: 60), () { if (_timerAtivo) { FirebaseFirestore.instance .collection('parametros') .doc('fkm2xe8krQ5F0Qsy5OIV') .update({'status': 'jogar'}); print('status update / wait 2'); } }); }
Future iniciarTemporizadorPegarStatus() async { try { DocumentSnapshot statusDoc = await FirebaseFirestore.instance .collection('parametros') .doc('fkm2xe8krQ5F0Qsy5OIV') .get();
statusParametros = statusDoc.data().toString(); print(statusParametros); if (statusParametros == 'jogar') { print('navigator wait votos / wait 2'); _timerAtivo = false; //! Navigator.of(context).pop(); Navigator.of(context).push(MaterialPageRoute( builder: (context) { return const WaitVotos(); }, )); } } catch (e) { print("Erro ao buscar no Firestore: $e"); }
estou com um erro nesta parte do codigo o campo esta virando 'jogar' mesmo sem passar os 60 segundos do Future.delayed e nao esta trocando de pagina
The text was updated successfully, but these errors were encountered:
Este não é um problema relacionado ao Modular. Utilize o fórum da Flutterando para postar sua dúvida: https://github.com/orgs/Flutterando/discussions
Sorry, something went wrong.
No branches or pull requests
late Timer _timer;
bool _timerAtivo = true;
@OverRide
void initState() {
super.initState();
}
String statusParametros = '';
Future statusUpdate() async {
Future.delayed(const Duration(seconds: 60), () {
if (_timerAtivo) {
FirebaseFirestore.instance
.collection('parametros')
.doc('fkm2xe8krQ5F0Qsy5OIV')
.update({'status': 'jogar'});
print('status update / wait 2');
}
});
}
Future iniciarTemporizadorPegarStatus() async {
try {
DocumentSnapshot statusDoc = await FirebaseFirestore.instance
.collection('parametros')
.doc('fkm2xe8krQ5F0Qsy5OIV')
.get();
}
estou com um erro nesta parte do codigo o campo esta virando 'jogar' mesmo sem passar os 60 segundos do Future.delayed e nao esta trocando de pagina
The text was updated successfully, but these errors were encountered: