Last active
October 28, 2021 21:17
-
-
Save s0nerik/e4eb475c69caaf12259627f1fab403cf to your computer and use it in GitHub Desktop.
Dart: Future<void> vs void execution
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
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