ConsoleUtils class

Console utilities for colorful and formatted CLI output.

Constructors

ConsoleUtils()

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
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

confirm(String message, {bool defaultValue = false}) bool
Ask for confirmation.
error(String message) → void
Print an error message with a red X.
formatDuration(Duration duration) String
Format duration in a human-readable way.
formatNumber(int number) String
Format a number with thousands separators.
Print a header with emphasis.
info(String message) → void
Print an info message with a blue info icon.
line([int length = 60]) → void
Print a horizontal line.
progressBar(int current, int total, {String prefix = '', int width = 40}) → void
Print a progress bar.
subHeader(String message) → void
Print a sub-header.
success(String message) → void
Print a success message with a green checkmark.
tableRow(List<String> columns, List<int> widths) → void
Print a table row with columns.
warning(String message) → void
Print a warning message with a yellow warning sign.
withSpinner<T>(String message, Future<T> action()) Future<T>
Print a spinner while waiting.

Constants

blue → const String
bold → const String
cyan → const String
dim → const String
gray → const String
green → const String
magenta → const String
red → const String
reset → const String
white → const String
yellow → const String