TestGesture class Null safety

A class for performing gestures in tests.

The simplest way to create a TestGesture is to call WidgetTester.startGesture.

Constructors

TestGesture({required EventDispatcher dispatcher, int pointer = 1, PointerDeviceKind kind = PointerDeviceKind.touch, int? device, int buttons = kPrimaryButton})
Create a TestGesture without dispatching any events from it. The TestGesture can then be manipulated to perform future actions. [...]

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

addPointer({Duration timeStamp = Duration.zero, Offset? location}) Future<void>
In a test, send a pointer add event for this pointer.
cancel({Duration timeStamp = Duration.zero}) Future<void>
End the gesture by canceling the pointer (as would happen if the system showed a modal dialog on top of the Flutter application, for instance).
down(Offset downLocation, {Duration timeStamp = Duration.zero}) Future<void>
Dispatch a pointer down event at the given downLocation, caching the hit test result.
downWithCustomEvent(Offset downLocation, PointerDownEvent event) Future<void>
Dispatch a pointer down event at the given downLocation, caching the hit test result with a custom down event.
moveBy(Offset offset, {Duration timeStamp = Duration.zero}) Future<void>
Send a move event moving the pointer by the given offset. [...]
moveTo(Offset location, {Duration timeStamp = Duration.zero}) Future<void>
Send a move event moving the pointer to the given location. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
removePointer({Duration timeStamp = Duration.zero, Offset? location}) Future<void>
In a test, send a pointer remove event for this pointer.
toString() String
A string representation of this object. [...]
inherited
up({Duration timeStamp = Duration.zero}) Future<void>
End the gesture by releasing the pointer.
updateWithCustomEvent(PointerEvent event, {Duration timeStamp = Duration.zero}) Future<void>
In a test, send a move event that moves the pointer by the given offset.

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited