oneShot method
- Duration duration = const Duration(milliseconds: 350),
- Curve curve = appleEaseInOut,
- int repeat = 0,
- bool reverse = false,
- Duration delay = Duration.zero,
- VoidCallback? onEnd,
- BooleanCallback? playIf,
Animate the effects applied to this widget.
Unlike animate, this method triggers the animation immediately without
a trigger
parameter.
The duration
parameter is used to set the duration of the animation.
The curve
parameter is used to set the curve of the animation.
The onEnd
parameter is used to set a callback that is called when the
animation ends.
The repeat
parameter is used to determine how the animation should be
repeated.
The reverse
parameter is used to determine whether the animation should
play backwards after each repetition.
The delay
parameter is used to set a delay before the animation starts.
The playIf
parameter is used to determine whether the animation should
be played or skipped. If the callback returns false, the animation will
be skipped, even when it is explicitly triggered.
Implementation
AnimatedEffect oneShot({
Duration duration = const Duration(milliseconds: 350),
Curve curve = appleEaseInOut,
int repeat = 0,
bool reverse = false,
Duration delay = Duration.zero,
VoidCallback? onEnd,
BooleanCallback? playIf,
}) {
return AnimatedEffect(
triggerType: AnimationTriggerType.oneShot,
duration: duration,
curve: curve,
onEnd: onEnd,
repeat: repeat,
reverse: reverse,
delay: delay,
playIf: playIf,
child: this,
);
}