drawBorder method

  1. @override
void drawBorder(
  1. Canvas canvas,
  2. Rect rect
)
override

Draws a custom border for the rounded rectangle shape.

This method is called when the shape needs to draw its border. The border is only drawn if borderWidth is greater than 0. The border follows the same rounded rectangle path as the shape itself.

canvas - The canvas on which to draw the border. rect - The bounding rectangle that defines the drawing area.

Implementation

@override
void drawBorder(Canvas canvas, Rect rect) {
  if (this.borderWidth > 0) {
    borderPaint.strokeWidth = borderWidth;
    borderPaint.color = borderColor;
    canvas.drawPath(generatePath(useBezier: false, rect: rect), borderPaint);
  }
}