animateWidgetInsetPulse method

Widget animateWidgetInsetPulse({
  1. int durationMs = 1200,
  2. bool repeat = true,
  3. bool animate = true,
})
  1. Inset Shadow Pulse (Loop)

Implementation

Widget animateWidgetInsetPulse(
    {int durationMs = 1200, bool repeat = true, bool animate = true}) {
  if (!animate) return this;
  return _baseAnimate(repeat: repeat, reverse: true).custom(
    duration: durationMs.ms,
    builder: (_, v, child) => Container(
      decoration: BoxDecoration(
        borderRadius: BorderRadius.circular(12),
        boxShadow: [
          BoxShadow(
            color: Colors.black.withColorOpacity(0.05 * v),
            blurRadius: 10 * v,
            spreadRadius: -5 * v,
            offset: Offset(2 * v, 2 * v),
          ),
        ],
      ),
      child: child,
    ),
  );
}