Target class sealed
The targets the plain vocabulary cannot express: the ones that need a property other than visible text, a scope, or an index.
await s.tap(Target.label('Add to cart')); // semantics label
await s.tap(Target.tooltip('Delete'));
await s.tap(Target.within(ShopKeys.cart, 'Buy'));
await s.tap(Target.nth('Buy', 1)); // the second one
Anything here composes: the scope and the index take targets of their own,
so Target.nth(Target.within(card, 'Buy'), 0) says what it looks like.
Constructors
- Target.at(double x, double y)
-
The widget at a point, in the coordinates every box in an observation is
reported in.
constfactory
- Target.containing(String text)
-
Visible text containing
text, where the plainStringform matches the whole string.constfactory - Target.label(String label)
-
By semantics label — the only handle on an icon button that carries no
text. Scenarios turn semantics on by themselves for this, since the
underlying finder throws without them.
constfactory
- Target.nth(Object target, int index)
-
The
indexth match oftarget, zero-based — for the deliberate ambiguity a verb would otherwise refuse.constfactory - Target.tooltip(String message)
-
By tooltip message.
constfactory
- Target.within(Object scope, Object child)
-
childas found insidescope— the scoped lookup that turns "the Buy button of this card" from afind.descendantincantation into a line that reads.scopematches itself too, so scoping to aListTileand asking for that same tile finds it.constfactory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- needsSemantics → bool
-
Whether resolving this needs the semantics tree, which a scenario turns
on lazily — it is not free, and it changes what the app builds.
no setter
- point → Offset?
-
The coordinate this target is, for the one form that is a coordinate —
Target.at, and nothing else.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toFinder(
) → Finder -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited