makeAnimation function
Animation<double>
makeAnimation(
- AnimationController controller,
- double targetValue,
- Curve? curve, {
- double initialValue = 0,
Make Animation from controller
to begin rotate effect.
Rotate final position is targetValue
.
Implementation
Animation<double> makeAnimation(
AnimationController controller,
double targetValue,
Curve? curve, {
double initialValue = 0,
}) {
final begin = initialValue % (2 * pi);
if (curve != null) {
final curved = CurvedAnimation(parent: controller, curve: curve);
return curved.drive(Tween(begin: begin, end: targetValue));
} else {
return controller.drive(Tween(begin: begin, end: targetValue));
}
}