TestGesture class

A class for performing gestures in tests.

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

Constructors

TestGesture({@required EventDispatcher dispatcher, @required HitTester hitTester, int pointer: 1, PointerDeviceKind kind: PointerDeviceKind.touch })
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

cancel() 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) Future<void>
Dispatch a pointer down event at the given downLocation, caching the hit test result.
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. [...]
up() 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.
@visibleForTesting
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

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