SafeLayoutElement class

The element managing the lifecycle, constraints, and painting of SafeLayout.

Inheritance
Available extensions

Constructors

SafeLayoutElement(SafeLayout widget)
Creates a SafeLayoutElement.

Properties

childElement Element?
Element for the main child widget.
getter/setter pair
constraints BoxConstraints?
The cached constraints from the last layout pass.
no setterinherited
depth int
The depth of this element in the widget tree.
getter/setter pairinherited
fallbackElement Element?
Element for the fallback widget.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
isDirty bool
Undocumented public member.
getter/setter pairinherited
layoutTraceId int
Cached tracer ID for layout of this element.
no setterinherited
mounted bool
Whether this element is currently mounted in the tree.
no setterinherited
owner BuildOwner?
The BuildOwner managing this element, resolving up the parent chain.
getter/setter pairinherited
paintTraceId int
Cached tracer ID for painting this element.
no setterinherited
paintTraceMetadata Map<String, String>?
Custom metadata for paint tracing.
no setterinherited
parent Element?
The parent element in the widget tree.
getter/setter pairinherited
rebuildTraceId int
Cached tracer ID for rebuilding this element.
no setterinherited
relativeOffset Offset
The cached local position assigned by the parent during layout.
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size Size
The resolved size of the element from the last layout pass.
no setterinherited
treeDepth int
Undocumented public member.
getter/setter pairinherited
useFallback bool
Whether the constraints are currently violated, displaying the fallback widget.
getter/setter pair
widget Widget
The widget that this element represents.
getter/setter pairinherited

Methods

dependOnInheritedWidgetOfExactType<T extends InheritedWidget>() → T?
Obtains the nearest inherited widget of the given type T.
inherited
getIntrinsicHeight(int width) int
Returns the intrinsic height of this element.
override
getIntrinsicWidth(int height) int
Returns the intrinsic width of this element.
override
hitTest(Point<int> globalPosition, [Offset parentOffset = Offset.zero]) List<Element>

Available on Element, provided by the HitTestExtension extension

Recursively finds all elements containing the given global coordinate.
layout(BoxConstraints constraints) Size
Calculates the size of the element based on the given constraints.
inherited
markNeedsBuild() → void
Marks this element as needing a build.
inherited
mount(Element? parent) → void
Adds this element to the tree as a child of parent.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
paint(Buffer buffer, Offset offset) → void
Paints the element and records tracing metrics.
inherited
performLayout(BoxConstraints constraints) Size
Hook for subclasses to perform layout within the given constraints.
override
performPaint(Buffer buffer, Offset offset) → void
Hook for subclasses to implement actual painting.
override
performRebuild() → void
Performs the actual rebuild and clears the dirty flag.
inherited
reassemble() → void
Called during hot reload to invalidate the element and trigger a rebuild.
inherited
rebuild() → void
Rebuilds the element.
override
toString() String
A string representation of this object.
inherited
unmount() → void
Removes this element from the tree.
override
update(Widget newWidget) → void
Updates this element to use a new Widget configuration.
override
visitChildren(void visitor(Element child)) → void
Invokes visitor on each child element of this node.
override

Operators

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