drawRect method
Implementation
void drawRect(Canvas canvas, int index, Paint paint) {
paint.style = PaintingStyle.stroke;
paint.color = color!;
if (type == VxPinBorderType.round) {
if (fill) {
paint.style = PaintingStyle.fill;
}
final Offset offset = Offset(
(2 * index + 1) * mSize / 2 + index * space,
mSize / 2,
);
final Rect rect = Rect.fromCircle(
center: offset,
radius: mSize / 2,
);
final RRect rRect = RRect.fromRectAndRadius(
rect,
Radius.circular(radius),
);
canvas.drawRRect(
rRect,
paint,
);
} else {
final Offset offset1 = Offset(
index * mSize + index * space,
mSize,
);
final Offset offset2 = Offset(
(index + 1) * mSize + index * space,
mSize,
);
canvas.drawLine(
offset1,
offset2,
paint,
);
}
}