ConsoleStyle class

Console output styling utilities for Laravel Artisan-style CLI commands.

Provides ANSI color formatting, banners, progress indicators, and structured output formatting (tables, key-value pairs).

Usage

// Success message
print(ConsoleStyle.success('Migration completed'));

// Error message
print(ConsoleStyle.error('File not found'));

// Table output
print(ConsoleStyle.table(['Name', 'Status'], [
  ['User', 'Active'],
  ['Admin', 'Inactive'],
]));

Constructors

ConsoleStyle()

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

Create a customizable package banner.
comment(String message) String
Write a comment or debug message in dim text.
error(String message) String
Write an error message with red X.
Format a section header with bold text.
info(String message) String
Write an info message with blue info symbol.
keyValue(String key, String value, {int keyWidth = 20}) String
Format a key-value pair with alignment.
line({String char = '─', int length = 50}) String
Draw a horizontal line.
newLine() String
Return an empty line.
step(int current, int total, String description) String
Display a progress step counter.
success(String message) String
Write a success message with green checkmark.
table(List<String> headers, List<List<String>> rows) String
Format data as a table with headers and rows.
warning(String message) String
Write a warning message with yellow warning symbol.

Constants

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