TestPointer class Null safety

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.


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. [...]


buttons int
The kind of buttons to simulate on Down and Move events. Defaults to kPrimaryButton.
device int
The device identifier used for events generated by this object. [...]
hashCode int
The hash code for this object. [...]
read-only, inherited
isDown bool
Whether the pointer simulated by this object is currently down. [...]
kind PointerDeviceKind
The kind of pointing device to simulate. Defaults to PointerDeviceKind.touch.
location Offset?
The position of the last event sent by this object. [...]
pointer int
The pointer identifier used for events generated by this object. [...]
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited


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 non-existent method or property is accessed. [...]
removePointer({Duration timeStamp = Duration.zero, Offset? location}) PointerRemovedEvent
Create a PointerRemovedEvent with the PointerDeviceKind the pointer was created with. [...]
scroll(Offset scrollDelta, {Duration timeStamp = Duration.zero}) PointerScrollEvent
Create a PointerScrollEvent (e.g., scroll wheel scroll; not finger-drag scroll) with the given delta. [...]
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. [...]
up({Duration timeStamp = Duration.zero}) PointerUpEvent
Create a PointerUpEvent. [...]


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