reset method

  1. @override
dynamic reset(
  1. dynamic productCurve(
    1. dynamic Function(
      1. double x
      )
    ),
  2. AnimationController animationController,
  3. Duration duration,
  4. Tween<Offset> tween,
  5. Offset current,
  6. double target,
)
override

Implementation

@override
reset(
  productCurve(Function(double x)),
  AnimationController animationController,
  Duration duration,
  Tween<Offset> tween,
  Offset current,
  double target,
) {
  // value-target
  // value -0/1
  tween.begin = current;
  tween.end =
      Offset(current.dx > 0 ? target : 0, current.dy > 0 ? target : 0);
  productCurve((x) {
    return curve.transform(x);
  });

  double value = animationController.value;
  animationController.duration = duration * (max(value - target, .5));
  animationController.forward(from: 0);
}