startGesture method
- Offset downLocation, {
- int? pointer,
- PointerDeviceKind kind = PointerDeviceKind.touch,
- int buttons = kPrimaryButton,
Creates a gesture with an initial appropriate starting gesture at a
particular point, and returns the TestGesture object which you can use
to continue the gesture. Usually, the starting gesture will be a down event,
but if kind
is set to PointerDeviceKind.trackpad, the gesture will start
with a panZoomStart gesture.
You can use createGesture if your gesture doesn't begin with an initial down or panZoomStart gesture.
See also:
- WidgetController.drag, a method to simulate a drag.
- WidgetController.timedDrag, a method to simulate the drag of a given widget in a given duration. It sends move events at a given frequency and it is useful when there are listeners involved.
- WidgetController.fling, a method to simulate a fling.
Implementation
Future<TestGesture> startGesture(
Offset downLocation, {
int? pointer,
PointerDeviceKind kind = PointerDeviceKind.touch,
int buttons = kPrimaryButton,
}) async {
final TestGesture result = _createGesture(pointer: pointer, kind: kind, buttons: buttons);
if (kind == PointerDeviceKind.trackpad) {
await result.panZoomStart(downLocation);
} else {
await result.down(downLocation);
}
return result;
}