animateSmoothGlow method

Widget animateSmoothGlow({
  1. Color color = Colors.blueAccent,
  2. bool animate = true,
})
  1. Smooth Glow

Implementation

Widget animateSmoothGlow({
  Color color = Colors.blueAccent,
  bool animate = true,
}) {
  if (!animate) return this;
  return this
      .animate(onPlay: (controller) => controller.repeat(reverse: true))
      .custom(
        duration: 1500.ms,
        builder:
            (context, value, child) => Container(
              decoration: BoxDecoration(
                borderRadius: BorderRadius.circular(12),
                boxShadow: [
                  BoxShadow(
                    color: color.withValues(alpha: 0.2 * value),
                    blurRadius: 15 * value,
                    spreadRadius: 2 * value,
                  ),
                ],
              ),
              child: child,
            ),
      );
}