StatefulComponentInstance class

Runtime instance of a StatefulComponent.

A StatefulComponentInstance owns and manages the ComponentState for its StatefulComponent, builds its child components, and coordinates their layout and rendering.

Responsibilities:

Lifecycle:

See also:

Inheritance

Constructors

StatefulComponentInstance(StatefulComponent component)
Creates a new StatefulComponentInstance for the given component.

Properties

bounds ↔ Rect
The current layout bounds for this component instance.
getter/setter pairinherited
childGap → int
Vertical spacing between children when laid out.
final
children ← List<Component>
Replaces the list of child components without building them.
no getter
childrenInstance → List<ComponentInstance>
Returns the list of runtime child instances.
no setteroverride
component → StatefulComponent
The configuration for this component instance.
final
direction → Axis
The primary axis along which children are laid out. Defaults to vertical stacking.
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
padding → EdgeInsets
The padding inside the component’s allocated space.
finalinherited
position → Position
The position of this component relative to its parent or container.
finalinherited
renderManager ↔ RenderManager?
The render manager that may schedule renders for this instance.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
state → ComponentState<StatefulComponent>
Lazily initializes and returns this component’s state.
no setter

Methods

fitHeight() → int
Calculates the total height required to fit all children, including the childGap between them.
override
fitWidth() → int
Calculates the maximum width required to fit all children.
override
measure(Size maxSize) → Size
Measures the size this component would take given maxSize.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
rebuild() → void
Rebuilds the child component list from the current state.
render(CanvasBuffer buffer, Rect bounds) → void
Renders all children into the given buffer within bounds.
override
shouldRenderChild(ComponentInstance child) → bool
Determines whether a given child should be rendered. Defaults to false, meaning the decision is left to layout/rendering code.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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