Created
February 23, 2020 09:32
-
-
Save torstenek/dcf684e3857f951eaac0cf9ccd9aa792 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
Future<String> fetchUserOrder() => | |
// Imagine that this function is | |
// more complex and slow. | |
Future.delayed( | |
Duration(seconds: 2), | |
() => 'Large Latte', | |
); | |
void main() async { | |
var order = await fetchUserOrder(); | |
print(order); | |
fetchUserOrder().then( | |
(order) => print('Your order is: $order') | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment