Created
November 26, 2019 00:01
-
-
Save r3dm1ke/0192f42eee95c9eb4e4ceb2cc9a536c2 to your computer and use it in GitHub Desktop.
Async/await in Dart
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
| // Creating a time duration of 1 minute | |
| const oneMinute = Duration(minutes: 1); | |
| // ... | |
| Future<void> printWithDelay(String msg) async { | |
| // Wait for one minute | |
| await Future.delayed(oneMinute); | |
| print(msg); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment