fore tutorial, we can easy to get the points of the small circles.
radians = List();
markup--strong markup--pre-strongfont-weight: 700;](for (double d markup--strong markup--pre-strongfont-weight: 700;](in sources) {
double radian = d * 2 * pi / total;
radians.add(radian);
} sources,
List colors,
double startAngle = 0.0,
double paintWidth = 10.0,
bool hasEnd = markup--strong markup--pre-strongfont-weight: 700;](false,
hasCurrent = markup--strong markup--pre-strongfont-weight: 700;](false,
int curIndex = 0,
curPaintWidth = 12.0}) {
markup--strong markup--pre-strongfont-weight: 700;](assert(sources != markup--strong markup--pre-strongfont-weight: 700;](null && sources.length > 0);
markup--strong markup--pre-strongfont-weight: 700;](assert(colors != markup--strong markup--pre-strongfont-weight: 700;](null && colors.length > 0);
markup--strong markup--pre-strongfont-weight: 700;](var paint = Paint()
..style = PaintingStyle.fill
..color = BLUE_NORMAL
..strokeWidth = paintWidth
..isAntiAlias = markup--strong markup--pre-strongfont-weight: 700;](true;
double total = 0;
markup--strong markup--pre-strongfont-weight: 700;](for (double d markup--strong markup--pre-strongfont-weight: 700;](in sources) {
total += d;
}
markup--strong markup--pre-strongfont-weight: 700;](assert(total > 0.0);
List radians = List();
markup--strong markup--pre-strongfont-weight: 700;](for (double d markup--strong markup--pre-strongfont-weight: 700;](in sources) {
double radian = d * 2 * pi / total;
radians.add(radian);
}
markup--strong markup--pre-strongfont-weight: 700;](var startA = startAngle;
[http://paint.style]()[http://paint.style](paint.style) = PaintingStyle.stroke;
markup--strong markup--pre-strongfont-weight: 700;](var curStartAngle = 0.0;
markup--strong markup--pre-strongfont-weight: 700;](for (int i = 0; i 1.0 && size.height > 1.0) {
print(">1.9");
_sizeUtil.logicSize = size;
}
markup--strong markup--pre-strongfont-weight: 700;](var paint = Paint()
..style = PaintingStyle.fill
..color = BLUE_NORMAL
..strokeWidth = 2.0
..isAntiAlias = markup--strong markup--pre-strongfont-weight: 700;](true;
paint.color = Colors.*markup--em markup--pre-emfont-feature-settings: "liga", "salt";](grey*[900];
// canvas.drawCircle(
// Offset(_sizeUtil.getAxisX(250), _sizeUtil.getAxisY(250.0)),
// _sizeUtil.getAxisBoth(200.0),
// paint);
paint.color = RED_DARK1;
paint.strokeWidth = 20;
[http://paint.style]()[http://paint.style](paint.style) = PaintingStyle.stroke;
markup--strong markup--pre-strongfont-weight: 700;](var center = Offset(
_sizeUtil.getAxisX(250.0),
_sizeUtil.getAxisY(250.0),
);
markup--strong markup--pre-strongfont-weight: 700;](var radius = _sizeUtil.getAxisBoth(200);
_drawArcGroup(
canvas,
center: center,
radius: radius,
sources: [1, 2, 1, 2, 1, 2, 1, 2, 1, 2],
colors: [BLUE_DARK1, RED_DARK1, BLUE_DARK2, GREEN_NORMAL, YELLOW_NORMAL],
paintWidth: 50.0,
startAngle: 0.0,
hasEnd: markup--strong markup--pre-strongfont-weight: 700;](true,
hasCurrent: markup--strong markup--pre-strongfont-weight: 700;](false,
curPaintWidth: 30.0,
curIndex: 1,
);
canvas.save();
canvas.restore();
}
Tags: