animateInsetPulse method

Widget animateInsetPulse({
  1. bool animate = true,
})
  1. Inner Shadow Pulse

Implementation

Widget animateInsetPulse({bool animate = true}) {
  if (!animate) return this;
  return this
      .animate(onPlay: (controller) => controller.repeat(reverse: true))
      .custom(
        duration: 1200.ms,
        builder:
            (context, value, child) => Container(
              decoration: BoxDecoration(
                borderRadius: BorderRadius.circular(12),
                boxShadow: [
                  BoxShadow(
                    color: Colors.black.withValues(alpha: 0.05 * value),
                    blurRadius: 10 * value,
                    spreadRadius: -5 * value,
                    offset: Offset(2 * value, 2 * value),
                  ),
                ],
              ),
              child: child,
            ),
      );
}