Is there an existing API to group a list of Future
object into one so that I can wait for all to complete? Like in javascript's Promise.all
.
Analog of Promise.all in Dart?
Something like Future.wait? api.dart.dev/stable/2.5.0/dart-async/Future/wait.html –
Molina
definitely something like this, please fire an answer –
Winona
Related question: https://mcmap.net/q/129790/-dartlang-wait-more-than-one-future/9157799 –
Quiberon
You can use the Future.wait
method documented here:
You can use Future.wait
Example
var futures = await Future.wait([
getAddress(),
getTeam(),
getEvents(),
]);
© 2022 - 2024 — McMap. All rights reserved.