IOSScrollViewFlingVelocityTracker class Null safety

A VelocityTracker subclass that provides a close approximation of iOS scroll view's velocity estimation strategy.

The estimated velocity reported by this class is a close approximation of the velocity an iOS scroll view would report with the same PointerMoveEvents, when the touch that initiates a fling is released.

This class differs from the VelocityTracker class in that it uses weighted average of the latest few velocity samples of the tracked pointer, instead of doing a linear regression on a relatively large amount of data points, to estimate the velocity of the tracked pointer. Adding data points and estimating the velocity are both cheap.

To obtain a velocity, call getVelocity or getVelocityEstimate. The esimated velocity is typically used as the initial flinging velocity of a Scrollable, when its drag gesture ends.

See also:

Inheritance

Constructors

IOSScrollViewFlingVelocityTracker(PointerDeviceKind kind)
Create a new IOSScrollViewFlingVelocityTracker.

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
kind PointerDeviceKind
The kind of pointer this tracker is for.
final, 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.
override
getVelocity() Velocity
Computes the velocity of the pointer at the time of the last provided data point. [...]
inherited
getVelocityEstimate() VelocityEstimate
Returns an estimate of the velocity of the object being tracked by the tracker given the current information available to the tracker. [...]
override
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 ==(Object other) bool
The equality operator. [...]
inherited