Spinner
PaymentSpinner is a thin ring that shows something is happening when you cannot say how long it will take, such as a status check.


PaymentSpinner(size: size);Variants
Section titled “Variants”Variants: small, medium, large; delayed.
When to use something else
Section titled “When to use something else”- Content loading into a known shape, such as a list: use a loading skeleton. It shows where content will appear.
- An action the person started, such as paying: use
PaymentButton’s busy state. The button already shows a spinner and blocks a second tap. - A payment whose result is not known: say so in words on the status screen. A spinner suggests the answer is coming, which may not be true.
Size and color
Section titled “Size and color”size is PaymentSize.small (16 dp), medium (20 dp, default), or large (32 dp); the ring’s stroke is 12% of it. color defaults to textSecondary, because waiting is not a brand moment. Pass the label color when the spinner sits on a filled surface, as the busy button does.
Reduced motion
Section titled “Reduced motion”When the platform or host asks for reduced motion, the ring is replaced by a still hourglass icon of the same size.
Pattern adoption
Section titled “Pattern adoption”Video loading uses a white 32 dp PaymentSpinner over the picture, with a 3.84 dp stroke. Reduced motion shows a 32 dp hourglass. The spinner is excluded from semantics because the video status already announces Loading video.
Delay and migration
Section titled “Delay and migration”Delay reserves space without announcing progress until the wait passes. One timer is canceled on disposal. A fast wait never flashes. Replace numeric size 20 with PaymentSize.medium; numeric sizes no longer compile.
Which variant when
Section titled “Which variant when”| Situation | Variant / composition | Payment example |
|---|---|---|
| Unknown-shape short wait | medium | Delay brief indicators; busy actions use the button’s built-in spinner. |
Use Loading skeleton when the content shape is known.
States
Section titled “States”Use the delay to avoid flashing the indicator for short requests. Under reduced motion, it shows a still hourglass instead of rotating.
Do and don’t
Section titled “Do and don’t”Do: Delay brief indicators; busy actions use the button’s built-in spinner.
Don’t: Create a second primary action to stop a loading indicator.
Content guidelines
Section titled “Content guidelines”Use a label that names the work, such as “Checking status”. Loading alone does not mean the payment succeeded.
Accessibility
Section titled “Accessibility”- Screen readers hear
semanticLabel, “Loading” by default (or the Indonesian equivalent). Set a more specific label when the words beside it do not already say what is loading, or wrap the spinner in ExcludeSemantics when they do.
PaymentSpinner
class PaymentSpinner extends StatefulWidget · lib/src/foundation/primitives.dart
Indeterminate progress for a wait with no known length: a thin ring, or a still hourglass when the platform or host asks for reduced motion.
Prefer a LoadingSkeleton where content is loading into a known shape, and PaymentButton's busy state for an action that is running; both already show progress. Screen readers hear semanticLabel, "Loading" by default.
| Parameter | Type | Default | Description |
|---|---|---|---|
size: | PaymentSize | PaymentSize.medium | Width and height. The ring's stroke is 12% of it. |
delay: | Duration | Duration.zero | — |
color: | Color? | — | Defaults to PaymentTheme.textSecondary: waiting is not a brand moment. |
semanticLabel: | String? | — | — |
PaymentSize
enum PaymentSize · lib/src/foundation/payment_tokens.dart
Visual size only; layout box and hit area stay at least 48×48 dp. Components document their heights.
| Value | Description |
|---|---|
small | Module headers, table or chip rows; never the main action. |
medium | Default, today's visual size. |
large | One primary action on a full-screen wide view. |