Spinner class

A single line that animates in place while a long step is running.

Builds and uploads spend minutes producing nothing on screen — flutter's own output only appears under --verbose — so without this the CLI looks hung. The spinner replaces that silence with a frame, the step's name and a live elapsed time, rewritten on one row.

It deliberately refuses to run in the places where an animation is wrong:

  • no terminal (piped output, CI logs) — the escape codes would be captured verbatim and every tick would become another line in the log
  • --quiet and --silent, which asked for less output, not more
  • --verbose, where the tool's own output is streaming and would be interleaved with the animation

Nothing it draws reaches the log file: the file is the record, and a record of an animation is noise.

Properties

describe String Function()?
Recomputes the label on every frame, when the caller has something that changes — the set of tasks currently running, for instance.
final
hashCode int
The hash code for this object.
no setterinherited
label String
Label shown next to the frame.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

erase() → void
Removes the spinner's line, leaving the cursor at the start of the row.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
paint() → void
Draws the current frame, replacing whatever the spinner drew last.
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

active Spinner?
The spinner currently drawing, if any.
getter/setter pair
isTerminal bool Function()
Whether that destination can show an animation. Replaced in tests.
getter/setter pair
sink StringSink Function()
Where the animation is drawn. Replaced in tests.
getter/setter pair
supported bool
Whether an animation is appropriate for the current output.
no setter

Static Methods

resetOutput() → void
Restores the production destination. Intended for tests.
run<T>(String label, Future<T> body(), {String describe()?}) Future<T>
Runs body with a spinner labelled label.

Constants

interval → const Duration
How often the frame advances.