ScreenContext class
A snapshot of the current screen's UI elements, extracted from the Flutter Semantics tree.
Constructors
-
ScreenContext({required List<
UiElement> elements, required DateTime capturedAt}) -
const
- ScreenContext.empty()
-
factory
Properties
- canScrollDown → bool
-
Whether there is more content below the current viewport.
no setter
- canScrollUp → bool
-
Whether there is more content above the current viewport.
no setter
- capturedAt → DateTime
-
When this snapshot was captured.
final
-
elements
→ List<
UiElement> -
All meaningful UI elements on the current screen.
final
- firstScrollable → UiElement?
-
Find the first scrollable element on screen, if any.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isEmpty → bool
-
no setter
- isNotEmpty → bool
-
no setter
- isScrollable → bool
-
Whether the screen has a scrollable area.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
elementsWithAction(
String action) → List< UiElement> - Get all elements that support a specific action.
-
findByLabel(
String query) → List< UiElement> - Find elements by label (case-insensitive partial match).
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toPromptString(
) → String - Format all elements as a human-readable prompt section for the LLM.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited