animateGhostGlow method
Widget
animateGhostGlow(
{ - Color color = Colors.redAccent,
- bool animate = true,
})
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,
),
);
}