buildAnimation method
void
buildAnimation({
- required Duration delay,
- required bool animate,
- required bool manualTrigger,
- required bool infinite,
- Function? onFinish,
- dynamic controllerCallback(
- AnimationController controller
inherited
Implementation
void buildAnimation({
required Duration delay,
required bool animate,
required bool manualTrigger,
required bool infinite,
Function? onFinish,
Function(AnimationController controller)? controllerCallback,
}) {
/// Launch the animation ASAP or wait until needed
if (animate && !manualTrigger) {
Future.delayed(delay, () {
if (disposed) return;
if (infinite) {
controller.repeat();
return;
}
(animate) ? controller.forward() : controller.reverse();
});
}
/// If the animation already happen, we can animate it back
if (!animate) {
if (disposed) return;
if (infinite) {
controller.stop();
return;
}
controller.animateBack(0);
}
}