Last active
August 14, 2020 16:25
-
-
Save nsmirosh/0e2e308b3e963d3e3397c9e83cb0d298 to your computer and use it in GitHub Desktop.
Dart's asynchronous Future callback demonstration
This file contains hidden or 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() { | |
| print('print statement before invoking the future'); | |
| Future.delayed(Duration(seconds: 2), () { | |
| print('Future completed!'); | |
| return 12; | |
| }); | |
| print('print statement after invoking the future'); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment