drawTopAndTextPhase method

void drawTopAndTextPhase(
  1. Canvas canvas,
  2. Rect rect,
  3. Offset center,
  4. double radius,
  5. int startDay,
  6. int endDay,
  7. Color topColor,
)

Draw top view and inside background

Implementation

void drawTopAndTextPhase(Canvas canvas, Rect rect, Offset center,
    double radius, int startDay, int endDay, Color topColor) {
  final startAngle = (2 * pi / totalTrimester) * startDay - pi / 2;
  final sweepAngle = (2 * pi / totalTrimester) * (endDay - startDay);

  ///Draw top view
  //if (theme == MenstrualCycleTheme.arcs) {
  final paint = Paint()
    ..color = topColor
    ..style = PaintingStyle.stroke
    ..strokeWidth = 30; // Manage Height of Outer circle
  canvas.drawArc(
    Rect.fromCircle(center: center, radius: radius),
    startAngle,
    sweepAngle,
    false,
    paint,
  );
  //}
}