waitAll method
- int batchSize = 50,
Implementation
Future<List<T>> waitAll({
int batchSize = 50,
}) async {
final futures = List<Future<T>>.from(this);
final results = <T>[];
while (futures.isNotEmpty) {
final batch = futures.take(batchSize).toList();
futures.removeRange(0, batch.length);
final batchResults = await Future.wait(batch);
results.addAll(batchResults);
}
return results;
}