McpTreeInspector class
Flutter widget tree inspector.
Reads the current tree state without adding any widgets. Ideal for Claude to verify values, states, and on-screen contents.
Usage:
final json = McpTreeInspector.inspect();
// json['widgets'] → list of all widgets with data
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
inspect(
) → Map< String, dynamic> - Walks the entire tree and returns a JSON with all widgets that contain data relevant for testing.
-
round(
double v) → double - Rounds to 1 decimal place to reduce noise in coordinates.
-
sanitizeList(
List< Map< list) → List<String, dynamic> >Map< String, dynamic> > - Recursively converts any non-finite double (NaN, Infinite) to null.
-
sanitizeMap(
Map< String, dynamic> map) → Map<String, dynamic> -
sanitizeValue(
dynamic value) → dynamic