- BuildContext context
override
Override this method to build widgets that depend on the state of the listenable (e.g., the current value of the animation).
Implementation
@override
Widget build(BuildContext context) {
// The ImageFilter layer created by setting filterQuality will introduce
// a saveLayer call. This is usually worthwhile when animating the layer,
// but leaving it in the layer tree before the animation has started or after
// it has finished significantly hurts performance.
return Transform(
transform: onTransform(animation.value),
alignment: alignment,
filterQuality: switch (animation.status) {
AnimationStatus.forward || AnimationStatus.reverse => filterQuality,
AnimationStatus.dismissed || AnimationStatus.completed => null,
},
child: child,
);
}