DebugSurface class
Owns the capture GlobalKey and the pure-Flutter capture / input
primitives. One instance per active Debug MCP host.
Constructors
Properties
-
captureKey
→ GlobalKey<
State< StatefulWidget> > -
Key for the
RepaintBoundarythe host wraps the rendered app in. The capture / layout primitives read the render object off this key.final - hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
captureScreenshot(
{double pixelRatio = 1.0, Rect? area}) → Future< Uint8List?> -
Capture the boundary to PNG bytes. Full window when
areais null; otherwise crops toarea(logical coordinates) via aPictureRecorderpass. Returns null when the boundary is not yet attached / sized. Copied fromui_control_tools._captureRegion. -
dispatchTap(
double x, double y, {int holdMs = 40}) → Future< void> -
Dispatch a synthetic tap at (
x,y) through Flutter'sGestureBindingpointer pipeline — the same path a real pointer takes. Copied fromui_control_tools._dispatchTap. -
layoutSnapshot(
) → List< Map< String, dynamic> > -
Walk the capture boundary's render subtree and emit one entry per
RenderMetaDatanode that AppPlayer's flutter_mcp_ui runtime wraps rendered widgets in. Each entry carries{type, id?, text?, label?, title?, rect:[x,y,w,h]}in capture-root coordinates. Returns an empty list when the boundary is not attached yet. Copied fromstudio_workspace._walkLayoutSnapshot. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
resolveElementRect(
String elementId) → Rect? -
Resolve an
elementIdto its on-screen rect (capture-root coords), or null when no node matches. Accepts<type>:<key>(strict) or a bare<key>(matches the first node whose id/text/label/title equals the key regardless of type). Copied fromstudio_workspace._resolveElementRect. -
toString(
) → String -
A string representation of this object.
inherited
-
typeText(
String text, {bool clear = true, bool submit = false, String? elementId}) → Future< Map< String, dynamic> > -
Type
textinto the currently-focusedEditableText. WhenelementIdis supplied the surface first taps its center to focus it (chaining).clearreplaces existing content (default) vs appends;submitfires the field'sonSubmittedafterwards. Copied fromui_control_tools' text-injection recipe.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited