Progress bar
A determinate progress bar. Set fraction between 0 and 1; it renders a █/░ bar of the given width with a trailing percentage. Pair it with Spring for buttery-smooth easing between values.
Install the package
Every component ships in the single dart_tui package.
$dart pub add dart_tui

final bar = ProgressModel(
fraction: 0.65,
width: 40,
label: 'Downloading',
);
// Renders: Downloading ████████████████████████░░░░░░░░░░░░ 65%
newView(bar.view().content);ProgressModel
| Property | Type | Description |
|---|---|---|
| fraction | double | Progress from 0.0 to 1.0 (asserted in range). |
| width | int | Bar width in columns. Defaults to 40. |
| label | String | Optional label rendered before the bar. |
| styles | ProgressStyles | Styling for filled cells, empty cells, label and percentage. |