progressBar static method

String progressBar(
  1. UfbtProgress progress, {
  2. int width = defaultBarWidth,
})

Implementation

static String progressBar(
  UfbtProgress progress, {
  int width = defaultBarWidth,
}) {
  final fraction = progress.isDone ? 1.0 : (progress.fraction ?? 0.0);
  final filled = (fraction * width).round();
  return '${barChar * filled}${' ' * (width - filled)} '
      '${percent(fraction * 100)}';
}