INNER CODE UNIT · Dart
end
hacan359/tonkatsu_box · tool/generate_demo_collections.dart:577
final int end = (i + 5).clamp(0, entries.length);
final List<MapEntry<String, String>> chunk = entries.sublist(i, end);
final List<String?> bases = await Future.wait(
chunk.map((MapEntry<String, String> e) => _downloadImageBase64(e.value)),
);
for (int j = 0; j < chunk.length; j++) {
if (bases[j] != null) {
result[chunk[j].key] = bases[j]!;
}
}
if (i > 0 && i % 20 == 0) {
stdout.write(' ...${result.length} images downloaded\n');
}
}