ModernMemoires/lib/utils/CirclePainter.dart

21 lines
521 B
Dart
Raw Normal View History

2023-12-17 23:00:31 +01:00
import 'package:flutter/material.dart';
class CirclePainter extends CustomPainter {
final double value;
CirclePainter(this.value);
@override
void paint(Canvas canvas, Size size) {
var paint = Paint()
..color = Colors.greenAccent.withOpacity(0.5)
..style = PaintingStyle.fill;
double radius = value * size.width / 100 * 1.5;
canvas.drawCircle(Offset(size.width / 6, size.height / 4), radius, paint);
}
@override
bool shouldRepaint(covariant CustomPainter oldDelegate) => true;
}