Skip to content
Get started
Menu
Get started

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.

Loading spinners in different sizes beside payment action labels.Loading spinners in different sizes beside payment action labels.
Spinner
example/lib/screens/gallery_feedback.dart
PaymentSpinner(size: size);

Variants: small, medium, large; delayed.

  • 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 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.

When the platform or host asks for reduced motion, the ring is replaced by a still hourglass icon of the same size.

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 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.

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.

Use the delay to avoid flashing the indicator for short requests. Under reduced motion, it shows a still hourglass instead of rotating.

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.

Use a label that names the work, such as “Checking status”. Loading alone does not mean the payment succeeded.

  • 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.

ParameterTypeDefaultDescription
size:PaymentSizePaymentSize.mediumWidth and height. The ring's stroke is 12% of it.
delay:DurationDuration.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.

ValueDescription
smallModule headers, table or chip rows; never the main action.
mediumDefault, today's visual size.
largeOne primary action on a full-screen wide view.