Skip to content

Instantly share code, notes, and snippets.

@ipondroid
Created October 24, 2019 08:19
Show Gist options
  • Select an option

  • Save ipondroid/df665eb46d860ab34c3a0f96e2fe18cb to your computer and use it in GitHub Desktop.

Select an option

Save ipondroid/df665eb46d860ab34c3a0f96e2fe18cb to your computer and use it in GitHub Desktop.
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