DefinitionList class
A fluent builder for creating styled definition lists.
Provides a chainable API for definition list configuration with support for the new Style system and per-item conditional styling.
final list = DefinitionList()
.item('Name', 'artisanal')
.item('Version', '1.0.0')
.item('License', 'MIT')
.termStyle(Style().bold().foreground(Colors.cyan))
.separator(':')
.render();
print(list);
- Inheritance
-
- Object
- Model
- ViewComponent
- StaticComponent
- DisplayComponent
- DefinitionList
- Available extensions
Constructors
- DefinitionList({RenderConfig renderConfig = const RenderConfig()})
- Creates a new empty definition list builder.
Properties
Methods
-
alignTerms(
bool value) → DefinitionList - Sets whether to align terms to the same width (default: true).
-
descriptionStyle(
Style style) → DefinitionList - Sets the description style.
-
gap(
int value) → DefinitionList - Sets the gap between term and description (default: 1).
-
indent(
int value) → DefinitionList - Sets the left indent (default: 2).
-
init(
) → Cmd? -
Returns an optional command to execute on program startup.
inherited
-
item(
String term, String description) → DefinitionList - Adds an item (term: description) to the list.
-
items(
Map< String, String> items) → DefinitionList - Adds multiple items from a map.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
render(
) → String -
Renders the component as a string.
override
-
separator(
String sep) → DefinitionList - Sets the separator between term and description (default: ':').
-
separatorStyle(
Style style) → DefinitionList - Sets the separator style.
-
styleFunc(
DefinitionStyleFunc func) → DefinitionList - Sets a style function for dynamic styling.
-
termStyle(
Style style) → DefinitionList - Sets the term style.
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
Msg msg) → (ViewComponent, Cmd?) -
Updates the component state in response to a message.
inherited
-
view(
) → String -
Renders the current model state for display.
inherited
-
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