formatProgress method

String formatProgress(
  1. double progress
)

Implementation

String formatProgress(double progress) {
  final percentage = (progress * 100).toStringAsFixed(1);
  final barWidth = _terminalWidth - 20;
  final completedWidth = (progress * barWidth).round();

  return [
    '[',
    Color.green('=' * completedWidth),
    Color.dim(' ' * (barWidth - completedWidth)),
    '] ',
    Color.yellow('$percentage%'),
  ].join('');
}