Created
November 28, 2021 23:22
-
-
Save sergeykondr/e9f6b1b9ca6a02f32fd182a1b0a86dbf to your computer and use it in GitHub Desktop.
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
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