press method Null safety
Dispatch a pointer down at the center of the given widget, assuming it is exposed.
The warnIfMissed
argument, if true (the default), causes a warning to be
displayed on the console if the specified Finder indicates a widget and
location that, were a pointer event to be sent to that location, would not
actually send any events to the widget (e.g. because the widget is
obscured, or the location is off-screen, or the widget is transparent to
pointer events).
Set the argument to false to silence that warning if you intend to not actually hit the specified element.
The return value is a TestGesture
object that can be used to continue the
gesture (e.g. moving the pointer or releasing it).
See also:
Implementation
Future<TestGesture> press(Finder finder, {int? pointer, int buttons = kPrimaryButton, bool warnIfMissed = true}) {
return TestAsyncUtils.guard<TestGesture>(() {
return startGesture(getCenter(finder, warnIfMissed: warnIfMissed, callee: 'press'), pointer: pointer, buttons: buttons);
});
}