Skip to main content

ProgressBar

An animated horizontal progress bar.

When to use it

Use a ProgressBar to show completion progress of a task — an upload, download, or multi-step process. Progress is expressed as value out of max. The fill animates smoothly on value changes.

Import

import 'package:catalyst_ui/catalyst_ui.dart';

Usage

ProgressBar(
value: 0.6,
tone: ProgressBarTone.success,
title: const Text('Uploading…'),
valueLabel: const Text('60%'),
)

Parameters

ParameterTypeDefaultDescription
valuedoublerequiredThe current progress value.
maxdouble1The maximum value.
toneProgressBarToneProgressBarTone.brandThe colour tone.
sizeProgressBarSizeProgressBarSize.mediumThe height variant.
titleWidget?nullAn optional label above the bar on the left.
valueLabelWidget?nullAn optional label above the bar on the right.

Sizes

ProgressBarSize values: small (4px), medium (8px, default), large (12px).

Tones

Built-in ProgressBarTone presets:

  • ProgressBarTone.brand — brand colour fill (default).
  • ProgressBarTone.success — green fill; healthy or successful progress.
  • ProgressBarTone.warning — amber fill; cautionary progress.
  • ProgressBarTone.danger — red fill; critical or error progress.

Define your own by subclassing ProgressBarTone and implementing resolve:

class SpeedTone extends ProgressBarTone {
const SpeedTone();


ProgressBarToneStyle resolve(ColorScheme cs) =>
ProgressBarToneStyle(fillColor: cs.brand);
}

See Variants & Tones for the full pattern.