animateGhostGlow method

Widget animateGhostGlow({
  1. Color color = Colors.redAccent,
  2. bool animate = true,
})
  1. Ghost Pulse Glow

Implementation

Widget animateGhostGlow(
    {Color color = Colors.redAccent, 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(
            boxShadow: [
              BoxShadow(
                color: color.withValues(alpha: 0.2 * value),
                blurRadius: 20 * value,
                spreadRadius: 5 * value,
              ),
            ],
          ),
          child: child,
        ),
      );
}