Skip to content

Instantly share code, notes, and snippets.

@madhawa-se
Last active May 1, 2020 12:50
Show Gist options
  • Save madhawa-se/98ea2938aca19a589b9db62231401dcf to your computer and use it in GitHub Desktop.
Save madhawa-se/98ea2938aca19a589b9db62231401dcf to your computer and use it in GitHub Desktop.
void main() {
// fetchUserOrder()
// .then((value) => print(value))
// .catchError((error) => print(error));
fetchUserOrder()
.then((value) => print(value))
.catchError((error) => showButton());
}
Future<String> fetchUserOrder() {
return Future.error(
"This is the error");
}
Future<String> showButton() {
return Future<String>.value('Back to the future!');
}
@madhawa-se
Copy link
Author

f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment