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.
const
factory
Target.containing(String text)
Visible text containing text, where the plain String form matches the whole string.
const
factory
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.
const
factory
Target.nth(Object target, int index)
The indexth match of target, zero-based — for the deliberate ambiguity a verb would otherwise refuse.
const
factory
Target.tooltip(String message)
By tooltip message.
const
factory
Target.within(Object scope, Object child)
child as found inside scope — the scoped lookup that turns "the Buy button of this card" from a find.descendant incantation into a line that reads. scope matches itself too, so scoping to a ListTile and asking for that same tile finds it.
const
factory

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