Widget class abstract

Base class for composable TUI widgets.

Widgets are Models with automatic child message forwarding and theme access.

Implemented types

Constructors

Widget({Key? key})

Properties

children List<Widget>
Child widgets that receive forwarded messages.
no setter
debugRenderObjectPassthrough bool
Whether this widget is intentionally transparent to render-object layouts.
no setter
focusable bool
Whether this widget can receive keyboard focus.
no setter
hashCode int
The hash code for this object.
no setterinherited
id String
Unique identifier for this widget.
no setter
key Key?
Key for preserving widget identity.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
theme Theme
Access the current theme.
no setter

Methods

buildCachedView<T>(T builder(), Object? cacheKey) → T
Returns a cached view if the cache key matches.
handleInit() Cmd?
Override this instead of init for widget-specific initialization.
handleIntercept(Msg msg) → (Widget, Cmd?)
Override this to handle messages before they reach children.
handleUpdate(Msg msg) → (Widget, Cmd?)
Override this to handle messages specific to this widget.
init() Cmd?
Called once when the widget is first mounted.
override
invalidateCachedView() → void
Clears any cached view for this widget.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override
update(Msg msg) → (Model, Cmd?)
Handles messages by forwarding to children then calling handleUpdate.
override
view() Object
Renders the widget to a string or View.
override

Operators

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

Static Methods

canUpdate(Widget oldWidget, Widget newWidget) bool
Whether the framework can update oldWidget's element to display newWidget.