Skip to content

Gauge

A single-value status indicator: a horizontal bar with an optional inline label and a percentage suffix. Sub-cell precision via the horizontal eighth-block glyphs (▏▎▍▌▋▊▉█).

See also: ProgressBar for a plain progress bar.

Import: package:fleury/fleury.dart, or package:fleury/fleury_core.dart in browser code.

Gauge(value: 0.62, label: 'CPU')

Distinct from ProgressBar by intent — Gauge is for status reading (CPU, memory, disk, signal), with a labeled, prominent presentation; ProgressBar is for task progress. Use ProgressBar when something is happening; use Gauge when something is.

Screen readers and agents get one chart node: semanticLabel (or label) with the percentage as its value.

ParameterTypeDefaultDescription
value:doublerequiredFraction filled, clamped to 0..1.
label:String?—Optional label shown before the bar.
showPercentage:booltrueWhether to show nn% after the bar.
color:Color?—Filled-bar color. Defaults to the theme’s primary.
thresholds:List<(double, Color)>const <(double, Color)>[]Optional (fraction, color) breakpoints, ascending. The fill takes the color of the highest breakpoint whose fraction the value has reached — the system-monitor convention (e.g. [(0.8, warning), (0.95, error)] turns the bar amber then red) so “high” reads without parsing the number.
trackColor:Color?—Empty-track color, always drawn dim. Defaults to the foreground of the theme’s muted style.
semanticLabel:String?—Label exposed through the semantic app graph. More
  • semanticLabel: Defaults to label when present, otherwise Gauge.

Gauge is defined in packages/fleury/lib/src/catalog/gauge.dart.

Category: Charts & meters · All widgets