drawTopAndTextPhaseInside method

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

Implementation

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

  if (startDay == currentMonth) {
    ///Draw top view
    final paint = Paint()
      ..color = highlightCurrentMonthColor!
      ..style = PaintingStyle.stroke
      ..strokeWidth = 25; // Manage Height of Outer circle
    canvas.drawArc(
      Rect.fromCircle(center: center, radius: radius),
      startAngle,
      sweepAngle,
      false,
      paint,
    );
  }

  final paint1 = Paint()
    ..color =
        (startDay == currentMonth) ? highlightCurrentMonthColor! : topColor
    ..style = PaintingStyle.stroke
    ..strokeWidth = 20; // Manage Height of Outer circle
  canvas.drawArc(
    Rect.fromCircle(center: center, radius: radius),
    startAngle,
    sweepAngle,
    false,
    paint1,
  );
}