TestPointer class

A class for generating coherent artificial pointer events.

You can use this to manually simulate individual events, but the simplest way to generate coherent gestures is to use TestGesture.

Constructors

TestPointer([int pointer = 1, PointerDeviceKind kind = PointerDeviceKind.touch, int? device, int buttons = kPrimaryButton])
Creates a TestPointer. By default, the pointer identifier used is 1, however this can be overridden by providing an argument to the constructor.

Properties

buttons int
The kind of buttons to simulate on Down and Move events. Defaults to kPrimaryButton.
no setter
device int
The device identifier used for events generated by this object.
no setter
hashCode int
The hash code for this object.
no setterinherited
isDown bool
Whether the pointer simulated by this object is currently down.
no setter
isPanZoomActive bool
Whether the pointer simulated by this object currently has an active pan/zoom gesture.
no setter
kind PointerDeviceKind
The kind of pointing device to simulate. Defaults to PointerDeviceKind.touch.
final
location Offset?
The position of the last event sent by this object.
no setter
pan Offset?
The pan offset of the last pointer pan/zoom event sent by this object.
no setter
pointer int
The pointer identifier used for events generated by this object.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addPointer({Duration timeStamp = Duration.zero, Offset? location}) PointerAddedEvent
Create a PointerAddedEvent with the PointerDeviceKind the pointer was created with.
cancel({Duration timeStamp = Duration.zero}) PointerCancelEvent
Create a PointerCancelEvent.
down(Offset newLocation, {Duration timeStamp = Duration.zero, int? buttons}) PointerDownEvent
Create a PointerDownEvent at the given location.
hover(Offset newLocation, {Duration timeStamp = Duration.zero}) PointerHoverEvent
Create a PointerHoverEvent to the given location.
move(Offset newLocation, {Duration timeStamp = Duration.zero, int? buttons}) PointerMoveEvent
Create a PointerMoveEvent to the given location.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
panZoomEnd({Duration timeStamp = Duration.zero}) PointerPanZoomEndEvent
Create a PointerPanZoomEndEvent to end the active pan/zoom sequence on this pointer.
panZoomStart(Offset location, {Duration timeStamp = Duration.zero}) PointerPanZoomStartEvent
Create a PointerPanZoomStartEvent (e.g., trackpad scroll; not scroll wheel or finger-drag scroll) with the given delta.
panZoomUpdate(Offset location, {Offset pan = Offset.zero, double scale = 1, double rotation = 0, Duration timeStamp = Duration.zero}) PointerPanZoomUpdateEvent
Create a PointerPanZoomUpdateEvent to update the active pan/zoom sequence on this pointer with updated pan, scale, and/or rotation values.
removePointer({Duration timeStamp = Duration.zero, Offset? location}) PointerRemovedEvent
Create a PointerRemovedEvent with the PointerDeviceKind the pointer was created with.
scale(double scale, {Duration timeStamp = Duration.zero}) PointerScaleEvent
Create a PointerScaleEvent (e.g., legacy pinch-to-zoom).
scroll(Offset scrollDelta, {Duration timeStamp = Duration.zero}) PointerScrollEvent
Create a PointerScrollEvent (e.g., scroll wheel scroll; not finger-drag scroll) with the given delta.
scrollInertiaCancel({Duration timeStamp = Duration.zero}) PointerScrollInertiaCancelEvent
Create a PointerScrollInertiaCancelEvent (e.g., user resting their finger on the trackpad).
setDownInfo(PointerEvent event, Offset newLocation, {int? buttons}) bool
If a custom event is created outside of this class, this function is used to set the isDown.
toString() String
A string representation of this object.
inherited
up({Duration timeStamp = Duration.zero}) PointerUpEvent
Create a PointerUpEvent.

Operators

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