DebugSurface class

Owns the capture GlobalKey and the pure-Flutter capture / input primitives. One instance per active Debug MCP host.

Constructors

DebugSurface()

Properties

captureKey GlobalKey<State<StatefulWidget>>
Key for the RepaintBoundary the 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 area is null; otherwise crops to area (logical coordinates) via a PictureRecorder pass. Returns null when the boundary is not yet attached / sized. Copied from ui_control_tools._captureRegion.
dispatchTap(double x, double y, {int holdMs = 40}) Future<void>
Dispatch a synthetic tap at (x, y) through Flutter's GestureBinding pointer pipeline — the same path a real pointer takes. Copied from ui_control_tools._dispatchTap.
layoutSnapshot() List<Map<String, dynamic>>
Walk the capture boundary's render subtree and emit one entry per RenderMetaData node 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 from studio_workspace._walkLayoutSnapshot.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolveElementRect(String elementId) Rect?
Resolve an elementId to 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 from studio_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 text into the currently-focused EditableText. When elementId is supplied the surface first taps its center to focus it (chaining). clear replaces existing content (default) vs appends; submit fires the field's onSubmitted afterwards. Copied from ui_control_tools' text-injection recipe.

Operators

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