drawArcOfSectors method

void drawArcOfSectors(
  1. Canvas canvas,
  2. Size canvasSize, {
  3. Color color = const Color.fromRGBO(128, 128, 128, 1),
  4. int? elementAttributeRow,
  5. List<SectorAttributes>? allSectorAttributes,
  6. Offset centerOffset = const Offset(0, 0),
  7. double angleArcDegres = 90,
  8. double angleOffset = 0,
  9. double rayonArc = 100,
})

Implementation

void drawArcOfSectors(Canvas canvas, Size canvasSize,
    {Color color = const Color.fromRGBO(128, 128, 128, 1),
    int? elementAttributeRow,
    List<SectorAttributes>? allSectorAttributes,
    Offset centerOffset = const Offset(0, 0),
    double angleArcDegres = 90,
    double angleOffset = 0,
    double rayonArc = 100}) {
  double angleDebut = (-angleArcDegres / 2) + angleOffset;

  final paint = new Paint();
  paint.color = color;

  var center = Offset(canvasSize.width / 2, canvasSize.height / 2);

  canvas.drawArc(
      Rect.fromCenter(
          center: Offset(
              center.dx + centerOffset.dx, center.dy + centerOffset.dy),
          width: rayonArc,
          height: rayonArc),
      angleDebut.degreesToRadians,
      (80.0).degreesToRadians,
      false,
      paint);
}