Skip to content

Instantly share code, notes, and snippets.

@madmag77
Created March 2, 2021 06:47
Show Gist options
  • Save madmag77/b922ae6eaa550f989565ee1e7f46a892 to your computer and use it in GitHub Desktop.
Save madmag77/b922ae6eaa550f989565ee1e7f46a892 to your computer and use it in GitHub Desktop.
[Dart article] Async code exceptions 4
await Future.delayed(Duration(seconds: 1), () {
print('Its ok so far');
}).then((value) {
final _ = 100 ~/ 0;
}).catchError((error) {
print('Cant divide to zero');
}).whenComplete(() {
print('Clean-up done');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment