Commit code. Update time: 2023-06-25

This commit is contained in:
TK
2023-06-25 11:50:55 +08:00
parent 2d74227878
commit 39a5f2fa92
244 changed files with 26147 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
import 'dart:math';
import 'package:flutter/material.dart';
///
/// desc:
///
class CirclePainter extends CustomPainter {
final double progress;
final double strokeWidth;
final Color color;
Paint _paint = Paint();
CirclePainter(
{this.progress = 0.0, this.strokeWidth = 1.0, this.color = Colors.white});
@override
void paint(Canvas canvas, Size size) {
_paint
..style = PaintingStyle.stroke
..strokeWidth = strokeWidth
..color = color;
double radius = min(size.width, size.height) / 2;
canvas.drawCircle(
Offset(size.width / 2, size.height / 2), radius * progress, _paint);
}
@override
bool shouldRepaint(covariant CirclePainter old) {
return progress != old.progress ||
strokeWidth != old.strokeWidth ||
color != old.color;
}
}