Skip to content

Instantly share code, notes, and snippets.

@gladimdim
Created October 1, 2021 07:15
Show Gist options
  • Save gladimdim/f67862569e1ff1f4d7ecb9672643f1d7 to your computer and use it in GitHub Desktop.
Save gladimdim/f67862569e1ff1f4d7ecb9672643f1d7 to your computer and use it in GitHub Desktop.
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