paintBar method

void paintBar(
  1. Canvas canvas,
  2. Size size, {
  3. required RRect rrect,
  4. required Paint line,
  5. required Paint edges,
  6. required Offset centerLeft,
  7. required Offset centerRight,
  8. required double halfLineWidth,
})

Implementation

void paintBar(
  Canvas canvas,
  Size size, {
  required RRect rrect,
  required Paint line,
  required Paint edges,
  required Offset centerLeft,
  required Offset centerRight,
  required double halfLineWidth,
}) {
  // DRAW TOP AND BOTTOM LINES
  canvas.drawPath(
    Path()
      ..addRect(
        Rect.fromPoints(
          rect.topLeft,
          rect.topRight - Offset(0.0, style.lineWidth),
        ),
      )
      ..addRect(
        Rect.fromPoints(
          rect.bottomRight + Offset(0.0, style.lineWidth),
          rect.bottomLeft,
        ),
      ),
    edges,
  );

  // DRAW EDGES
  paintEdgesBarPath(
    canvas,
    size,
    edges: edges,
    centerLeft: centerLeft,
    centerRight: centerRight,
    halfLineWidth: halfLineWidth,
  );

  paintIcons(canvas, centerLeft: centerLeft, centerRight: centerRight);

  paintIndicator(canvas, size);
}