Skip to content

Instantly share code, notes, and snippets.

@mraleph
Created September 8, 2019 15:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mraleph/545e80fa9ba2d8361fd4abcfa47d9c12 to your computer and use it in GitHub Desktop.
Save mraleph/545e80fa9ba2d8361fd4abcfa47d9c12 to your computer and use it in GitHub Desktop.
Future<void> f() async {
print("f invoked");
await Future.value(10);
print("f continued");
}
Future<void> g() async {
print("g invoked");
await Future.value(10);
print("g continued");
}
h() async {
print("h invoked");
final futures = [f(), g()];
print("h continued");
await Future.wait(futures);
print("h done");
}
void main() {
h();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment