TickedProgress class

A progress line whose spinner is driven from a sidecar isolate.

mason_logger's own Progress animates with a Timer.periodic on the isolate that created it. Generation saturates that isolate — RoutesHandler .parse resolves every unit through the analyzer synchronously between awaits — so the timer never fires and the line stops on whatever frame it last drew. The work is progressing; the only thing that stalled is the thing telling the user so.

Moving the timer off that isolate is the whole point: the sidecar is doing nothing but painting, so it keeps painting no matter what main is stuck in.

Ported from TickedProgress in Morgan's import_ozempic, written for this same symptom. Adapted in two places, both load-bearing here and not there:

  • the non-animated fallback reproduces mason_logger's output byte for byte rather than printing a plain line — see _paintStatic;
  • whether to animate and whether to emit ANSI are separate questions, so a caller can animate onto a pipe without pretending it is a terminal.

One caveat the sidecar buys: main and the sidecar write to the same stdout without a lock, so anything main prints during a step (only logger.detail, under --verbose) can interleave with a frame. On a terminal the next frame repaints over it.

Constructors

TickedProgress(String _message, {Level level = Level.info, bool? animate, Duration tickInterval = const Duration(milliseconds: 80)})
Starts a progress line reading message.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

cancel() → void
Ends the line and erases it.
complete([String? message]) → void
Ends the line with a .
fail([String? message]) → void
Ends the line with a .
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
update(String message) → void
Repaints with a new message, without advancing the spinner frame.

Operators

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