build method

  1. @override
Widget build(
  1. BuildContext context,
  2. Widget child,
  3. AnimationController controller,
  4. EffectEntry entry,
)
override

Builds the widgets that implement the effect on the target child, based on the provided AnimationController and EffectEntry.

Implementation

@override
Widget build(
  BuildContext context,
  Widget child,
  AnimationController controller,
  EffectEntry entry,
) {
  Animation<double> animation = entry.buildAnimation(controller);
  return getOptimizedBuilder<double>(
    animation: animation,
    builder: (_, __) {
      Color color = ColorTween(begin: begin, end: end).evaluate(animation) ??
          const Color(0x00000000);
      return ColorFiltered(
        colorFilter: ColorFilter.mode(color, blendMode ?? defaultBlendMode),
        child: child,
      );
    },
  );
}