PointerEventResampler class Null safety

Class for pointer event resampling.

An instance of this class can be used to resample one sequence of pointer events. Multiple instances are expected to be used for multi-touch support. The sampling frequency and the sampling offset is determined by the caller.

This can be used to get smooth touch event processing at the cost of adding some latency. Devices with low frequency sensors or when the frequency is not a multiple of the display frequency (e.g., 120Hz input and 90Hz display) benefit from this.

The following pointer event types are supported: PointerAddedEvent, PointerHoverEvent, PointerDownEvent, PointerMoveEvent, PointerCancelEvent, PointerUpEvent, PointerRemovedEvent.

Resampling is currently limited to event position and delta. All pointer event types except PointerAddedEvent will be resampled. PointerHoverEvent and PointerMoveEvent will only be generated when the position has changed.




hashCode int
The hash code for this object. [...]
read-only, inherited
hasPendingEvents bool
Returns true if a call to sample can dispatch more events.
isDown bool
Returns true if pointer is currently down.
isTracked bool
Returns true if pointer is currently tracked.
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited


addEvent(PointerEvent event) → void
Enqueue pointer event for resampling.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
sample(Duration sampleTime, Duration nextSampleTime, HandleEventCallback callback) → void
Dispatch resampled pointer events for the specified sampleTime by calling callback. [...]
stop(HandleEventCallback callback) → void
Stop resampling. [...]
toString() String
A string representation of this object. [...]


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