-
-
Save sfmskywalker/24e9e30b38d0bf8a8c453e7b38051514 to your computer and use it in GitHub Desktop.
Flutter recurring task
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Future<void> delay(int milliseconds, Function callback) async { | |
await Future.delayed(Duration(milliseconds: milliseconds)); | |
callback(); | |
} | |
void doTask() { | |
print('Hello!'); | |
delay(1000, DoTask); | |
} | |
doTask(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment