Skip to content

Instantly share code, notes, and snippets.

@sergeykondr
Created November 28, 2021 23:55
Show Gist options
  • Save sergeykondr/848a8d66603e25bfe5b78985415c1d77 to your computer and use it in GitHub Desktop.
Save sergeykondr/848a8d66603e25bfe5b78985415c1d77 to your computer and use it in GitHub Desktop.
как будто обернули во фьюче и 1ую строчку вызвали сразу
void main() async {
methodA();
methodB(); //намеренно вызвано без await
methodA();
}
methodA() {
print('A');
}
methodB() async {
print('B start');
Future.microtask(() {
print('microtask 1');
});
Future(() {
print('Future B');
print('1');
Future.microtask(() {
print('microtask 2');
});
Future(() {
print('Future DDDDB');
});
print('B end');
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment