Last active
November 25, 2019 23:23
-
-
Save legalcodes/57e6085344cbd1719ed42b32f8ad1bce to your computer and use it in GitHub Desktop.
What is a future? (completed)
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
Future<void> fetchUserOrder() { | |
// Imagine that this function is fetching user info from another service or database | |
return Future.delayed(Duration(seconds: 3), () => print('Large Latte')); | |
} | |
void main() { | |
fetchUserOrder(); | |
print('Fetching user order...'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Comment in line 2 says user info, but code in line 3 is about user order.