Created
October 16, 2022 19:04
-
-
Save ValeryPonomarenko/32e8360c92e71a066b208fd4c367cf91 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class _DiagramPainter extends CustomPainter { | |
_DiagramPainter({ | |
required this.dotRadius, | |
required this.startBarRadius, | |
required this.layers, | |
required this.layersSpacing, | |
required this.dotsSpacing, | |
required this.progress, | |
required Color dotColor, | |
required Color progressDotColor, | |
}) : _paint = Paint() | |
..color = dotColor | |
..style = PaintingStyle.fill, | |
_progressPaint = Paint() | |
..color = progressDotColor | |
..style = PaintingStyle.fill, | |
_dotDiameter = dotRadius * 2, | |
_dotsSizeWithSpacing = dotRadius * 2 + dotsSpacing; | |
final double dotRadius; | |
final double startBarRadius; | |
final int layers; | |
final double layersSpacing; | |
final double dotsSpacing; | |
final double progress; | |
final Paint _paint; | |
final Paint _progressPaint; | |
final double _dotDiameter; | |
final double _dotsSizeWithSpacing; | |
static const _startAngle = 270.0; | |
static const _circle = 360.0; | |
static const _halfCircle = 180.0; | |
@override | |
void paint(Canvas canvas, Size size) { | |
// implement this later | |
} | |
@override | |
bool shouldRepaint(covariant _DiagramPainter oldDelegate) => | |
dotRadius != oldDelegate.dotRadius || | |
startBarRadius != oldDelegate.startBarRadius || | |
layers != oldDelegate.layers || | |
layersSpacing != oldDelegate.layersSpacing || | |
dotsSpacing != oldDelegate.dotsSpacing || | |
progress != oldDelegate.progress; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment