Loading class

Loading animation manager for CLI applications.

This singleton class manages a rotating loading animation that displays while long-running operations are in progress. The animation is automatically disabled in CI/CD environments to keep logs clean.

The animation cycles through: '-', '\', '|', '/'

Example:

final loading = Loading();

// Start the loading animation
loading.start();

try {
  // Perform long-running operation
  await longRunningOperation();

  // Print status updates (animation pauses automatically)
  printMessage('Step 1 complete');
  printMessage('Step 2 complete');
} finally {
  // Stop the loading animation
  loading.stop();
}

Constructors

Loading()
factory

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

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
printerrMessage(String? message) → void
printMessage(Object? message) → void
start() → void
stop() → void
toString() String
A string representation of this object.
inherited

Operators

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