VelocityTracker class

Computes a pointer's velocity based on data from PointerMoveEvents.

The input data is provided by calling addPosition. Adding data is cheap.

To obtain a velocity, call getVelocity or getVelocityEstimate. This will compute the velocity based on the data added so far. Only call these when you need to use the velocity, as they are comparatively expensive.

The quality of the velocity estimation will be better if more data points have been received.

Constructors

VelocityTracker()

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

addPosition(Duration time, Offset position) → void
Adds a position as the given time to the tracker.
getVelocity() Velocity
Computes the velocity of the pointer at the time of the last provided data point. [...]
getVelocityEstimate() VelocityEstimate
Returns an estimate of the velocity of the object being tracked by the tracker given the current information available to the tracker. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
@pragma('vm:entry-point'), inherited
toString() String
Returns a string representation of this object.
inherited

Operators

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