withAnimation method
Widget
withAnimation(
- GarnishAnimation animation, {
- ValueKey? animationKey,
- VoidCallback? onComplete,
- GarnishAnimationController? controller,
Wraps this widget with a GarnishAnimated.
Example:
Text('Hello').withAnimation(GarnishAnimation.fadeSlideUp())
With trigger:
final shake = GarnishAnimation.shake();
Text('Error!').withAnimation(shake)
// Later, trigger it:
shake.trigger();
Implementation
Widget withAnimation(
GarnishAnimation animation, {
ValueKey? animationKey,
VoidCallback? onComplete,
GarnishAnimationController? controller,
}) {
return GarnishAnimated(
animation: animation,
animationKey: animationKey,
onComplete: onComplete,
controller: controller,
child: this,
);
}