ScopedWidgetTreeSnapshot class

A snapshot representing a specific subtree within a WidgetTreeSnapshot.

This class provides a focused view of a subtree starting from the origin node. It is used to analyze and interact with a specific part of the widget tree, isolated from the rest. Each instance of this class captures the state and structure of the subtree at a specific point in time, facilitating targeted analysis and debugging within that scope.

The snapshot includes various utility methods to traverse and inspect the subtree, such as obtaining all elements, widgets, and nodes in depth-first order. It also manages the lifecycle of the snapshot, ensuring its validity only within the current frame.

Constructors

ScopedWidgetTreeSnapshot({required WidgetTreeNode origin, required ScopedWidgetTreeSnapshot? parentScope})
This constructor initializes a snapshot of a subtree, starting at the provided origin. It captures the state of the subtree for further analysis or operations.

Properties

allElements List<Element>
Returns the Elements in depth-first order
no setter
allNodes List<WidgetTreeNode>
Returns all WidgetTreeNode in tree in depth-first order
no setter
allWidgets List<Widget>
Returns the Widgets in depth-first order
no setter
hashCode int
The hash code for this object.
no setterinherited
isFromThisFrame bool
Returns true if the snapshot represents the state of the widgets as of the current frame. If a new frame has been pumped, it returns false, indicating that the snapshot is outdated.
no setter
origin WidgetTreeNode
The root node of the subtree to be captured in this snapshot.
final
parentScope ScopedWidgetTreeSnapshot?
The parent scope from which this subtree snapshot is derived.
final
root → WidgetTreeSnapshot
The root of the widget tree
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scopes List<ScopedWidgetTreeSnapshot>
Returns the scopes from closest to root
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
scope(WidgetTreeNode origin) ScopedWidgetTreeSnapshot
Creates a scoped snapshot of the subtree starting at origin
toString() String
A string representation of this object.
override
toStringDeep() String
Returns a detailed string representation of the subtree starting at the origin.

Operators

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