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<double> animation = buildAnimation(controller, entry);
return getOptimizedBuilder<double>(
animation: animation,
builder: (_, __) {
LinearGradient gradient = _buildGradient(animation.value);
return ShaderMask(
blendMode: blendMode ?? defaultBlendMode,
shaderCallback: (bounds) => gradient.createShader(bounds),
child: child,
);
},
);
}