// Custom painter for drawing a continuous wavy filled circle with heartbeat effect import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'dart:math' as math; class FilledWaveRingPainter extends CustomPainter { final double animationValue; FilledWaveRingPainter(this.animationValue); @override void paint(Canvas canvas, Size size) { Paint paint = Paint() ..color = Colors.orange.withOpacity(0.8) ..style = PaintingStyle.fill; Path path = Path(); // Modify wave amplitude to create a heartbeat-like effect double waveAmplitude = 10 + 10 * math.sin(animationValue * 2 * math.pi); // Varying amplitude double waveFrequency = 5; // Frequency of the wave oscillation // Draw a continuous filled wave path around the circumference of the circle path.moveTo(size.width / 2, size.height / 2); for (double angle = 0; angle <= 2 * math.pi; angle += 0.02) { double radius = size.width / 2; double x = (size.width / 2) + (radius + waveAmplitude * math.sin(waveFrequency * angle)) * math.cos(angle); double y = (size.height / 2) + (radius + waveAmplitude * math.sin(waveFrequency * angle)) * math.sin(angle); path.lineTo(x, y); } path.close(); // Draw the filled wave path canvas.drawPath(path, paint); } @override bool shouldRepaint(CustomPainter oldDelegate) { return true; } }