logDownloadProgress method

void logDownloadProgress({
  1. required String url,
  2. required int received,
  3. required int total,
})

Log download progress

Implementation

void logDownloadProgress({
  required String url,
  required int received,
  required int total,
}) {
  if (!enabled) return;
  final percentage = (received / total * 100).toStringAsFixed(1);
  final receivedMB = (received / (1024 * 1024)).toStringAsFixed(2);
  final totalMB = (total / (1024 * 1024)).toStringAsFixed(2);
  _outputLine('$_cyan📥 Downloading:$_reset $url');
  _outputLine(
    '$_yellow Progress:$_reset $percentage% ($receivedMB MB / $totalMB MB)',
  );
}