ProgressBar class

A facility for drawing a progress bar in the terminal.

The bar is instantiated with the total number of "ticks" to be completed, and progress is made by calling tick. The bar is drawn across one entire line, like so:

[----------                                                   ]

The hyphens represent completed progress, and the whitespace represents remaining progress. The character representing completed progress can be changed by specifying tickCharacters in the ProgressBar constructor.

If there is no terminal, the progress bar will not be drawn.

Constructors

ProgressBar({int maxValue = 100, Coordinate? startCoordinate, int? barWidth, bool showSpinner = true, List<String> tickCharacters = const <String>['-', '\\', '|', '/']})

Properties

hashCode int
The hash code for this object.
no setterinherited
maxValue int
The value that represents completion of the progress bar.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showSpinner bool
Whether the spinner should be shown.
final
tickCharacters List<String>
The character used to draw the progress "tick".
final

Methods

clear() → void
Clear the progress bar from the terminal, allowing other logging to be printed.
complete() → void
Draw the progress bar as complete.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
tick() → void
Progress the bar by one tick towards its maxValue.
toString() String
A string representation of this object.
inherited

Operators

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