formatProgress method
Renders an ASCII progress bar.
Implementation
String formatProgress(
int current,
int total, {
String? label,
int barWidth = 30,
}) {
final pct = total > 0 ? (current / total).clamp(0.0, 1.0) : 0.0;
final filled = (pct * barWidth).round();
final empty = barWidth - filled;
final bar = '${'█' * filled}${'░' * empty}';
final pctStr = '${(pct * 100).toStringAsFixed(0)}%';
final prefix = label != null ? '$label ' : '';
return '$prefix${theme.info}$bar${theme.reset} '
'${theme.number}$pctStr${theme.reset} ($current/$total)';
}