Velocity getVelocity()

Computes the velocity of the pointer at the time of the last provided data point.

This can be expensive. Only call this when you need the velocity.

getVelocity() will return null if no estimate is available or if the velocity is zero.

Source

Velocity getVelocity() {
  _Estimate estimate = _strategy.getEstimate();
  if (estimate != null && estimate.degree >= 1) {
    return new Velocity(
      pixelsPerSecond: new Offset( // convert from pixels/ms to pixels/s
        estimate.xCoefficients[1] * 1000,
        estimate.yCoefficients[1] * 1000
      )
    );
  }
  return null;
}