Skip to content

Instantly share code, notes, and snippets.

@devjaime
Created March 21, 2021 04:47
Show Gist options
  • Select an option

  • Save devjaime/222ae74db77dc153933aab0650fe770c to your computer and use it in GitHub Desktop.

Select an option

Save devjaime/222ae74db77dc153933aab0650fe770c to your computer and use it in GitHub Desktop.
Para ejecutar todos estos futuros al mismo tiempo, utilice Future.wait. Esto toma una lista o futuros y devuelve un futuro de listas
final api = CovidAPI();
final values = await Future.wait([
api.getCases(),
api.getRecovered(),
api.getDeaths(),
]);
print(values); // [1000, 100, 10]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment