Created
October 24, 2019 08:20
-
-
Save ipondroid/121fbf91f5eb6f728a1c79e1222ecf45 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
void future_wait(String url1, String url2) { | |
Future.wait([ | |
http.get(url1), | |
http.get(url2), | |
Future.error('Future.error()'), | |
], | |
cleanUp: (value) { print('CleanUp() : ${value?.statusCode}'); } | |
).then((value) { | |
for (var f in value) { | |
print('statusCode: ${f?.statusCode}'); | |
} | |
}).catchError((error) { print('error : $error'); }); | |
} | |
// output | |
// CleanUp() : 200 | |
// CleanUp() : 200 | |
// error : Future.error() | |
// ouput | |
// statusCode: 200 | |
// statusCode: 200 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment