Created
February 18, 2022 11:42
-
-
Save HaradaKumiko/185ab0b132eab7dbbe8db3cb8a3b6b31 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> pesanOrder() async { | |
var order = await prosesOrder(); | |
return 'Pesananan anda... $order'; | |
} | |
Future<String> prosesOrder() => Future.delayed( | |
const Duration(seconds: 2), | |
() => 'Large Latte', | |
); | |
void main() async { | |
print('Mengambil order...'); | |
print(await pesanOrder()); | |
print('Order berhasil....'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output
![image](https://user-images.githubusercontent.com/42530587/154676998-8832d28e-1850-4370-8b03-bf384ee03b11.png)