ScenarioAim class

Where a verb's finger went.

A scenario runs with no cursor and no pointer of any kind on screen, so a picture of a tap is indistinguishable from a picture of the screen sitting still — the step says tap "Cappuccino" and nothing in the pixels says which Cappuccino, or where. This is the missing half: the box the verb resolved to, in the app's own logical pixels, measured on the frame the verb was about to act on.

One class for both ends of the wire, like ScenarioNotification: the scenario measures it, the panel and the exported page draw it, and the schema exists once. It rides the step inline — six numbers and a word at most, so there is no file to fetch before a viewer can point at something.

The coordinates are the ones every other rect in a report is in: the view's logical pixels, the same space InspectLayout writes and the same space the screenshot is laid out in, so drawing it needs no transform.

The rect does not always mean "the thing that was touched". For a pointer verb it is the box the finder resolved — or a box of no size at the point, when the target named a coordinate rather than a widget. For scrollTo it is the scrollable's viewport and toward is where the target is; for keyboard it is the band the stage is about to take or give back. The verb on the step says which, and it is the verb a viewer switches on.

Constructors

ScenarioAim({required double x, required double y, required double width, required double height, double? dx, double? dy, String? toward})
const

Properties

dx → double?
How far the finger travelled, for drag — the verb's own offset, in the same logical pixels. Null for a verb that did not move.
final
dy → double?
final
hashCode → int
The hash code for this object.
no setterinherited
height → double
final
point → (double, double)
The point the pointer went down on — derived rather than recorded, so the schema cannot disagree with itself the way a second pair of numbers beside the first pair could.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
toward → String?
Which way a verb that acts on a region travels — 'up', 'down', 'left', 'right'. Null for every verb that acts on a point, and for a region verb that moves nothing.
final
width → double
final
x → double
The resolved target's box — what the verb aimed at, not necessarily what draws the button. tap('Cappuccino') resolves the Text, so this is the word's box and the tap landed at its centre, which is the truth of what happened and is why a viewer marks the point as well as the box.
final
y → double
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, Object?>
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

fromJson(Object? json) → ScenarioAim?