Created
October 24, 2019 08:19
-
-
Save ipondroid/df665eb46d860ab34c3a0f96e2fe18cb to your computer and use it in GitHub Desktop.
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
| void future_forEach(List<String> urls) { | |
| Future.forEach(urls, (url) { | |
| print('url:$url'); | |
| http.get(url).then((response) { | |
| print('statusCode:${response.statusCode}'); | |
| }); | |
| }).catchError((error) { print('$error'); }); | |
| } | |
| // output | |
| // url:https://www.google.com | |
| // url:https://duckduckgo.com | |
| // statusCode:200 | |
| // statusCode:200 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment