Spinner class

A one-cell animated glyph that reports ongoing work.

The spinner drives an AnimationController over the frame index range and restarts it from the beginning on completion, because the controller has no repeat mode. It advances one frame every interval.

A spinner animates for as long as it is mounted. Remove it from the tree when the work finishes rather than trying to stop it in place.

if (_loading) const Spinner()
Inheritance

Constructors

Spinner({Key? key, Color? color, List<String> frames = SpinnerFrames.dots, Duration interval = const Duration(milliseconds: 80)})
Configures a spinner cycling frames once every interval per frame.
const

Properties

color Color?
Color of the glyph. Falls back to ThemeData.accent.
final
frames List<String>
Glyphs cycled in order, each rendered for interval.
final
hashCode int
The hash code for this object.
no setterinherited
interval Duration
Time each frame stays on screen.
final
key Key?
Controls how this widget replaces another of the same type.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createState() State<Spinner>
Creates the mutable State for this widget.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited