DisplayComponent class abstract
Base type for display-only UI building blocks.
Display components are stateless, render-only widgets that produce styled terminal output. They don't handle input or maintain state.
Subclasses implement render to produce their output string. The view method (from StaticComponent) delegates to render.
Example
class MyBadge extends DisplayComponent {
const MyBadge(this.label);
final String label;
@override
String render() {
return Style().bold().background(Colors.blue).render(' $label ');
}
}
- Inheritance
-
- Object
- Model
- ViewComponent
- StaticComponent
- DisplayComponent
- Implementers
- Alert
- AlertComponent
- Box
- BoxBuilder
- BulletList
- ColumnComponent
- ColumnsComponent
- Comment
- CommentComponent
- CompositeComponent
- DefinitionList
- DefinitionListComponent
- ExceptionComponent
- GroupedDefinitionList
- HorizontalTableComponent
- KeyValue
- LinkComponent
- LinkGroupComponent
- Markdown
- NumberedList
- Panel
- PanelComponent
- ProgressBar
- ProgressBarComponent
- RowComponent
- Rule
- SimpleExceptionComponent
- SpinnerFrame
- StyledBlock
- StyledBlockComponent
- StyledText
- Table
- TableComponent
- TaskComponent
- Text
- TitledBlockComponent
- Tree
- TreeComponent
- TwoColumnDetail
- TwoColumnDetailComponent
- TwoColumnDetailList
- Available extensions
Constructors
- DisplayComponent()
-
const
Properties
Methods
-
init(
) → Cmd? -
Returns an optional command to execute on program startup.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
render(
) → String - Renders the component as a styled string.
-
toString(
) → String -
A string representation of this object.
override
-
update(
Msg msg) → (ViewComponent, Cmd?) -
Updates the component state in response to a message.
inherited
-
view(
) → String -
Renders the current model state for display.
override
-
writelnTo(
Console io) → void -
Available on DisplayComponent, provided by the DisplayComponentExtension extension
Renders the component and writes it to the console.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited