CommandWidget class

A top-level command output widget that composes output widgets for different output formats (text, json, yaml).

textOutputUi, jsonOutputUi, yamlOutputUi: Rendered on success.

textErrorUi, jsonErrorUi, yamlErrorUi: Rendered on error, typically an Exception.

Inheritance

Constructors

CommandWidget({required OutputWidget textOutputUi, required OutputWidget jsonOutputUi, required OutputWidget yamlOutputUi, required OutputWidget textErrorUi, required OutputWidget jsonErrorUi, required OutputWidget yamlErrorUi})
const
CommandWidget.text({required OutputWidget textOutputUi, OutputWidget? jsonOutputUi, OutputWidget? yamlOutputUi, OutputWidget? textErrorUi, OutputWidget? jsonErrorUi, OutputWidget? yamlErrorUi})
Convenience constructor that auto-creates standard json, yaml, and error widgets unless provided.

Properties

hashCode → int
The hash code for this object.
no setterinherited
jsonErrorUi → OutputWidget
final
jsonOutputUi → OutputWidget
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
textErrorUi → OutputWidget
final
textOutputUi → OutputWidget
final
yamlErrorUi → OutputWidget
final
yamlOutputUi → OutputWidget
final

Methods

build(OutputContext context) → OutputWidget
Builds this widget using the output context.
override
buildTree(OutputContext context) → WidgetNode
Builds the tree of widgets below this one. This is not usually to be overridden by subclasses.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
render({required CommandLogger logger}) → void
Renders this widget using the given IO facade.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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