ScreenshotCapture class

Captures screenshots of the app content for visual LLM context.

Uses a RepaintBoundary key to capture only the app content (excluding the AI overlay), then downscales to targetWidth to keep the payload manageable for LLM APIs (~100-200KB PNG).

Constructors

ScreenshotCapture({required GlobalKey<State<StatefulWidget>> appContentKey, int targetWidth = 720})
const

Properties

appContentKey GlobalKey<State<StatefulWidget>>
Key of the RepaintBoundary wrapping the app content.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
targetWidth int
Target width in pixels. Height is scaled proportionally. 720px gives good readability while keeping payload small.
final

Methods

capture() Future<Uint8List?>
Capture the app content as PNG bytes.
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