render method

  1. @override
void render(
  1. Canvas canvas,
  2. double w,
  3. double h
)
override

Implementation

@override
void render(Canvas canvas, double w, double h) {
  final hasStroke = stroke != Colors.transparent && strokeWidth > 0;
  final inset = hasStroke ? strokeWidth / 2 : 0.0;
  final rect = Rect.fromLTWH(inset, inset, w - inset * 2, h - inset * 2);
  final rr = RRect.fromRectXY(rect, _rx, _ry);
  if (fill != Colors.transparent) canvas.drawRRect(rr, fillPaint);
  if (hasStroke) canvas.drawRRect(rr, strokePaint);
}