animateRadarScan method

Widget animateRadarScan({
  1. Color color = Colors.blueAccent,
  2. bool animate = true,
})
  1. Radar Scan

Implementation

Widget animateRadarScan({
  Color color = Colors.blueAccent,
  bool animate = true,
}) {
  if (!animate) return this;
  return this
      .animate(onPlay: (controller) => controller.repeat())
      .custom(
        duration: 2000.ms,
        builder:
            (context, value, child) => Stack(
              alignment: Alignment.center,
              children: [
                Container(
                  decoration: BoxDecoration(
                    shape: BoxShape.circle,
                    border: Border.all(
                      color: color.withValues(alpha: (1 - value).clamp(0, 1)),
                      width: value * 20,
                    ),
                  ),
                  width: value * 200,
                  height: value * 200,
                ),
                child,
              ],
            ),
      );
}