animateWidgetGlassGlow method

Widget animateWidgetGlassGlow({
  1. Color glowColor = Colors.amberAccent,
  2. int durationMs = 3000,
  3. bool repeat = true,
  4. bool animate = true,
})
  1. Glass Morph Glow

Implementation

Widget animateWidgetGlassGlow(
    {Color glowColor = Colors.amberAccent,
    int durationMs = 3000,
    bool repeat = true,
    bool animate = true}) {
  if (!animate) return this;
  return _baseAnimate(repeat: repeat, reverse: true).custom(
    duration: durationMs.ms,
    builder: (_, v, c) => Container(
      decoration: BoxDecoration(
        borderRadius: BorderRadius.circular(16),
        boxShadow: [
          BoxShadow(
              color:
                  glowColor.withColorOpacity(0.2 * (1 - (v - 0.5).abs() * 2)),
              blurRadius: 20,
              spreadRadius: 2)
        ],
      ),
      child: c,
    ),
  );
}