Widgets

ProgressRing

ProgressRing

A circular progress indicator. Leave value unset for an indeterminate spinner, or set it (0.0–1.0) for determinate progress. Use progress_bar for a linear bar.

Example

# indeterminate spinner
progress_ring()

# determinate (60%)
progress_ring(value: 0.6, stroke_width: 4)

Common properties

  • valuenil (spinner) or 0.01.0
  • color
  • bgcolor
  • stroke_width
  • stroke_cap
  • stroke_align
  • semantics_label

Usage

Show a spinner while loading, then swap in content:

body = column(children: [progress_ring()])
page.add(body)

records = load_records          # slow work
page.update(body, children: records.map { |r| text(r.name) })

For a horizontal bar, progress_bar(value: 0.6).

Complete API

Helpers

  • progress_ring(**props)
  • progressring(**props)

Accepted properties

  • align — Alignment of the control within its parent.
  • animate_align — Animates alignment changes.
  • animate_margin — Animates margin changes.
  • animate_offset — Animates offset changes.
  • animate_opacity — Animates opacity changes.
  • animate_position — Animates position changes.
  • animate_rotation — Animates rotation changes.
  • animate_scale — Animates scale changes.
  • animate_size — Animates size changes.
  • aspect_ratio — Width-to-height ratio to maintain.
  • badge — Badge drawn on the corner of the control.
  • bgcolor — Background color.
  • bottom — Bottom offset when positioned inside a stack.
  • col — Responsive column span (1-12) per breakpoint.
  • color — Foreground color.
  • data — Arbitrary value you can attach to the control and read back in handlers.
  • disabled — Disables interaction when true.
  • expand — Fills the available space along the parent's main axis when true.
  • expand_loose — Like expand, but only grows up to the child's natural size.
  • height — Fixed height in logical pixels.
  • key — Stable identity used to preserve state across rebuilds.
  • left — Left offset when positioned inside a stack.
  • margin — Outer spacing around the control.
  • offset — Translation offset applied to the control.
  • opacity — Opacity from 0.0 (transparent) to 1.0 (opaque).
  • padding — Inner spacing between the border and the content.
  • right — Right offset when positioned inside a stack.
  • rotate — Rotation applied to the control.
  • rtl — Renders right-to-left when true.
  • scale — Scale transform applied to the control.
  • semantics_label — Sets the semantics label property.
  • semantics_value — Sets the semantics value property.
  • size_change_interval — Throttle interval for on_size_change, in ms.
  • size_constraints — Min/max size constraints.
  • stroke_align — Sets the stroke align property.
  • stroke_cap — Sets the stroke cap property.
  • stroke_width — Stroke width.
  • tooltip — Text shown on hover/long-press.
  • top — Top offset when positioned inside a stack.
  • track_gap — Sets the track gap property.
  • value — The control's current value.
  • visible — Hides the control when false.
  • width — Fixed width in logical pixels.
  • year_2023 — Sets the year 2023 property.

Events

  • on_animation_end — Fired when an animation completes.
  • on_size_change — Fired when the control's size changes.

Wire reference

  • Family: materials
  • Widget type: progressring