Skip to content

Instantly share code, notes, and snippets.

@s0nerik
Last active October 28, 2021 21:17
Show Gist options
  • Save s0nerik/e4eb475c69caaf12259627f1fab403cf to your computer and use it in GitHub Desktop.
Save s0nerik/e4eb475c69caaf12259627f1fab403cf to your computer and use it in GitHub Desktop.
Dart: Future<void> vs void execution
import 'dart:async';
void main() {
fn1();
scheduleMicrotask(() {
print('microtask after fn1');
});
fn2();
scheduleMicrotask(() {
print('microtask after fn2');
});
}
Future<void> fn1() async {
print('fn1');
}
void fn2() {
print('fn2');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment