reportProgress static method

void reportProgress(
  1. String operation,
  2. int current,
  3. int total
)

Reports progress with a simple percentage indicator.

Parameters:

  • operation: Description of the current operation
  • current: Current progress value
  • total: Total expected value

Implementation

static void reportProgress(String operation, int current, int total) {
  final percentage = (current / total * 100).toStringAsFixed(1);
  final progressBar = _generateProgressBar(current, total, width: 20);

  print('\r$operation: $progressBar $percentage% ($current/$total)');
}