wrap method

  1. @override
Widget wrap(
  1. BuildContext context,
  2. Widget child,
  3. double progress
)
override

Wraps the child widget with this specific visual effect.

Implementation

@override
Widget wrap(BuildContext context, Widget child, double progress) {
  final double pulse = 0.75 + 0.25 * math.sin(progress * 2 * math.pi);
  return Container(
    decoration: BoxDecoration(
      boxShadow: [
        BoxShadow(
          color: color.withValues(alpha: 0.3 * pulse),
          blurRadius: blurRadius * pulse,
          spreadRadius: spreadRadius,
        ),
      ],
    ),
    child: child,
  );
}