I want to do something after a lot of future function done,bu I do not know how to write the code in dart?
the code like this:
for (var d in data) {
d.loadData().then()
}
// when all loaded
// do something here
but I don't want to wait them one by one:
for (var d in data) {
await d.loadData(); // NOT NEED THIS
}
how to write those code in dart?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…