ParentComponentInstance class abstract Components Core Layout

Base class for a component instance that has child components.

A ParentComponentInstance represents a ComponentInstance that can contain other ComponentInstances, and optionally control their layout direction and rendering behavior.

See also:

  • ComponentInstance — the base interface for all component instances.
  • AppInstance — a specialized parent instance that owns the application's root component tree.
Inheritance
Implementers

Constructors

ParentComponentInstance.new(Component component)
Creates a parent component instance for the given component.

Properties

bounds Rect
The current layout bounds for this component instance.
getter/setter pairinherited
childrenInstance List<ComponentInstance>
The direct child component instances managed by this parent.
no setter
direction Axis
The primary axis along which children are laid out. Defaults to vertical stacking.
no setter
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
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

fitHeight() int
Returns the height this component should occupy based on its content or layout rules.
inherited
fitWidth() int
Returns the width this component should occupy based on its content or layout rules.
inherited
measure(Size maxSize) Size
Measures the size this component would like to occupy, given a maximum available size.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
render(CanvasBuffer buffer, Rect bounds) → void
Renders the component into the provided CanvasBuffer using the given bounds as the drawing area.
inherited
shouldRenderChild(ComponentInstance child) bool
Determines whether a given child should be rendered. Defaults to false, meaning the decision is left to layout/rendering code.
toString() String
A string representation of this object.
inherited

Operators

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