MotionSpline constructor

MotionSpline(
  1. {required PointSetterCallback setter,
  2. required List<Offset> points,
  3. required double duration,
  4. Curve? curve}
)

Creates a new spline motion with a set of points. The setter is a callback for setting the positions, points define the spline, and duration is the time for the motion to complete. Optionally a curve can be used for easing.

Implementation

MotionSpline({
  required this.setter,
  required this.points,
  required double duration,
  Curve? curve,
}) : super(duration, curve) {
  _dt = 1.0 / (points.length - 1.0);
}