Components class

Higher-level console UI components (Laravel-style).

Access via io.components.

io.components.task('Running migrations', run: () async {
  return TaskResult.success;
});
io.components.twoColumnDetail('Name', 'Value');
io.components.bulletList(['Item 1', 'Item 2']);
io.components.alert('Important!');
io.components.spin('Loading...', run: () async { ... });

Constructors

Components({required Console io})
Creates a components helper for the given I/O instance.

Properties

hashCode int
The hash code for this object.
no setterinherited
io Console
The I/O instance to use for output.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
style Style
The style configuration.
no setter

Methods

alert(Object message) → void
Displays a boxed alert message.
bulletList(Iterable<Object> items) → void
Displays a bulleted list of items.
comment(Object message) → void
Displays a comment (dimmed text with // prefix).
definitionList(Map<String, Object?> definitions) → void
Renders a definition list (term/definition pairs).
error(String title, Object message) → void
Displays an error block with a header.
horizontalTable(Map<String, Object?> data) → void
Displays a horizontal table (row-as-headers layout).
info(String title, Object message) → void
Displays an info block with a header.
line([int width = 0]) → void
Displays a line separator.
muted(String text) String
Helper to apply muted styling.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
renderException(Object exception, [StackTrace? stackTrace]) → void
Renders an exception with pretty formatting.
rule([String? text]) → void
Displays a horizontal rule with optional centered text.
spin<R>(String message, {required FutureOr<R> run()}) Future<R>
Runs a callback while displaying a processing indicator.
success(String title, Object message) → void
Displays a success block with a header.
task(String description, {FutureOr<TaskResult> run()?}) Future<TaskResult>
Displays a task with dotted fill and DONE/FAIL/SKIPPED status.
textArea(TextAreaModel model, {ProgramOptions? options}) Future<String?>
Runs a multi-line text editor inline and returns the submitted value.
toString() String
A string representation of this object.
inherited
twoColumnDetail(String first, [String? second]) → void
Displays two columns aligned with proper spacing.
warn(String title, Object message) → void
Displays a warning block with a header.

Operators

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