snapPoint method
Implementation
double snapPoint(
double value,
double velocity,
List<double> points,
) {
var point = value + 0.2 * velocity;
var deltas = points.map((p) => (point - p).abs()).toList();
var minDelta = deltas.reduce(min);
return points.firstWhere((p) => (point - p).abs() == minDelta);
}