Skip to content

Instantly share code, notes, and snippets.

@sergeykondr
Created November 28, 2021 23:22
Show Gist options
  • Save sergeykondr/e9f6b1b9ca6a02f32fd182a1b0a86dbf to your computer and use it in GitHub Desktop.
Save sergeykondr/e9f6b1b9ca6a02f32fd182a1b0a86dbf to your computer and use it in GitHub Desktop.
void main() async {
methodA(1);
methodB('non'); //намеренно вызвано без await
methodA(2);
Future(() {
print('Future 1');
});
await methodB('await');
Future(() {
print('Future 2');
});
methodA(3);
}
methodA(n) {
print('A $n');
}
methodB(n) async {
print('B start from $n');
Future(() {
print('Future B non await from $n');
});
await Future(() {
print('Future B from $n');
});
print('B end from $n');
await Future(() {
print('Future B2 form $n');
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment