Created
October 1, 2021 07:15
-
-
Save gladimdim/f67862569e1ff1f4d7ecb9672643f1d7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import 'dart:async'; | |
void main() async { | |
print('a'); | |
await waitTime(Duration(seconds: 3)); | |
print('b'); | |
} | |
Future waitTime(Duration duration) { | |
Completer completer = Completer(); | |
print('created completer'); | |
Future.delayed(duration, () => completer.complete()); | |
return completer.future; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment