rectPainting method
void
rectPainting(})
Implementation
void rectPainting(Canvas canvas, Size canvasSize, Color color,
double rectSize, double xOffset, double yOffset,
{double? radius}) {
final paint = new Paint();
paint.color = color;
var center = Offset(canvasSize.width / 2, canvasSize.height / 2);
canvas.drawRRect(
RRect.fromLTRBR(
center.dx.roundToDouble() - (rectSize / 2) + xOffset,
center.dy.roundToDouble() - (rectSize / 2) + yOffset,
center.dx.roundToDouble() + (rectSize / 2) + xOffset,
center.dy.roundToDouble() + (rectSize / 2) + yOffset,
Radius.circular(radius ?? 0)),
paint);
}