platformCurve static method

PlatformCurve platformCurve(
  1. Curve curve
)

curve for the platforms: a Cubic as is, any other curve sampled at evenly spaced times.

Implementation

static PlatformCurve platformCurve(Curve curve) {
  if (identical(curve, Curves.easeInOut)) return PlatformCurve.easeInOut;
  if (curve is Cubic) return PlatformCurve.cubic(curve.a, curve.b, curve.c, curve.d);
  return PlatformCurve.sampled([for (var i = 0; i < _curveSamples; i++) curve.transform(i / (_curveSamples - 1))]);
}