build method
Widget
build(
- BuildContext context,
- Widget child,
- AnimationController controller,
- EffectEntry entry,
override
Builds the widgets necessary to implement the effect, based on the provided AnimationController and EffectEntry.
Implementation
@override
Widget build(
BuildContext context,
Widget child,
AnimationController controller,
EffectEntry entry,
) {
Animation<Offset> animation = buildAnimation(controller, entry);
return getOptimizedBuilder<Offset>(
animation: animation,
builder: (_, __) {
final double sigmaX = _normalizeSigma(animation.value.dx);
final double sigmaY = _normalizeSigma(animation.value.dy);
return ImageFiltered(
enabled: sigmaX > minBlur || sigmaY > minBlur,
imageFilter: ImageFilter.blur(
sigmaX: sigmaX,
sigmaY: sigmaY,
tileMode: TileMode.decal,
),
child: child,
);
},
);
}