mercredi 30 décembre 2020

HOW I CAN SLEEP BUT IF A CONDITION IS TRUE STOP THE SLEPPING AND CONTINUE IN DART?

this is an example of sleep in dart, but I want that with a boolean condition. If its true break the sleep. put an if before the sleep is not the solution because it will be alwys false before the sleep but while the sleep is working maybe the variable change the value. Anybody knows a possible solution. Thank you

 sleep(Duration(milliseconds: 2000));

Aucun commentaire:

Enregistrer un commentaire