reset method
dynamic
reset(
- dynamic productCurve(
- dynamic Function(
- double x
- dynamic Function(
- AnimationController animationController,
- Duration duration,
- Tween<
Offset> tween, - Offset current,
- double target,
override
Implementation
@override
reset(
productCurve(Function(double x)),
AnimationController animationController,
Duration duration,
Tween<Offset> tween,
Offset current,
double target,
) {
double value = animationController.value;
// value-target
// value -0/1
if (value < target) {
// value-target
// value -1
productCurve((x) {
return (target - value) / (1 - value) * (x - 1) + target;
});
animationController.duration = duration * (target - value);
animationController.forward();
} else {
// value-target
// value -0
productCurve((x) {
return (value - target) / value * x + target;
});
animationController.duration = duration * (value - target);
animationController.reverse();
}
}