ProgressCallback typedef

ProgressCallback = void Function(int count, int total)

Progress callback function type for file upload/download operations.

The callback receives two parameters:

  • count: Number of bytes transferred so far
  • total: Total number of bytes to transfer

Example:

onProgress: (count, total) {
  final percentage = (count / total * 100).toStringAsFixed(1);
  print('Progress: $percentage%');
}

Implementation

typedef ProgressCallback = void Function(int count, int total);