Element class abstract
Undocumented public member.
- Implemented types
- Implementers
- CanvasElement
- ColumnElement
- ElementWidgetElement
- FlexibleElement
- GridElement
- HelpElement
- InheritedElement
- LayoutBuilderElement
- LazyListElement
- LazyTableElement
- LeafElement
- LeftBorderElement
- LinearProgressIndicatorElement
- ListViewElement
- ModalDismissBarrierElement
- NumberSelectorElement
- PaginatorElement
- PositionedElement
- RichTextElement
- RowElement
- SafeLayoutElement
- ScrollBarElement
- SevenSegmentDisplayElement
- SingleChildElement
- SparklineElement
- SpinnerElement
- SplitPaneElement
- StackElement
- StatefulElement
- StatelessElement
- SubpixelRippleWidgetElement
- TabBarElement
- TableElement
- TabPanelElement
- TextElement
- TimelineCanvasElement
- TimerWidgetElement
- WindowElement
- Available extensions
Constructors
Properties
- constraints → BoxConstraints?
-
The cached constraints from the last layout pass.
no setter
- depth ↔ int
-
The depth of this element in the widget tree.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- isDirty ↔ bool
-
Undocumented public member.
getter/setter pair
- layoutTraceId → int
-
Cached tracer ID for layout of this element.
no setter
- mounted → bool
-
Whether this element is currently mounted in the tree.
no setter
- owner ↔ BuildOwner?
-
The BuildOwner managing this element, resolving up the parent chain.
getter/setter pair
- paintTraceId → int
-
Cached tracer ID for painting this element.
no setter
-
paintTraceMetadata
→ Map<
String, String> ? -
Custom metadata for paint tracing.
no setter
- parent ↔ Element?
-
The parent element in the widget tree.
getter/setter pair
- rebuildTraceId → int
-
Cached tracer ID for rebuilding this element.
no setter
- relativeOffset ↔ Offset
-
The cached local position assigned by the parent during layout.
getter/setter pair
- 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 setter
- treeDepth ↔ int
-
Undocumented public member.
getter/setter pair
- widget ↔ Widget
-
The widget that this element represents.
getter/setter pairoverride-getter
Methods
-
dependOnInheritedWidgetOfExactType<
T extends InheritedWidget> () → T? -
Obtains the nearest inherited widget of the given type
T.override -
getIntrinsicHeight(
int width) → int - Returns the intrinsic height of this element.
-
getIntrinsicWidth(
int height) → int - Returns the intrinsic width of this element.
-
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.
-
markNeedsBuild(
) → void - Marks this element as needing a build.
-
mount(
Element? parent) → void -
Adds this element to the tree as a child of
parent. -
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.
-
performLayout(
BoxConstraints constraints) → Size - Hook for subclasses to perform layout within the given constraints.
-
performPaint(
Buffer buffer, Offset offset) → void - Hook for subclasses to implement actual painting.
-
performRebuild(
) → void - Performs the actual rebuild and clears the dirty flag.
-
reassemble(
) → void - Called during hot reload to invalidate the element and trigger a rebuild.
-
rebuild(
) → void - Rebuilds the element.
-
toString(
) → String -
A string representation of this object.
inherited
-
unmount(
) → void - Removes this element from the tree.
-
update(
Widget newWidget) → void - Updates this element to use a new Widget configuration.
-
visitChildren(
void visitor(Element child)) → void -
Invokes
visitoron each child element of this node.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited