INNER CODE UNIT · Dart

end

hacan359/tonkatsu_box · tool/generate_all_snes.dart:206

    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) {
        images[chunk[j].key] = bases[j]!;
      } else {
        failed++;
      }
    }

    if (i % 50 == 0 && i > 0) {
      stdout.write('  ${images.length} downloaded, $failed failed '
          '(${i + chunk.length}/${entries.length})\n');

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…