drawDefaultLabel method
Draws the default label in the canvas.
Implementation
void drawDefaultLabel(Canvas canvas, Paint backgroundPaint) {
if (label != null) {
final painter = TextPainter(
textDirection: TextDirection.ltr,
text: TextSpan(
text: label,
style: textStyle,
),
)..layout();
canvas.drawRect(
Rect.fromLTWH(
pixelSize * 6,
-1,
painter.width + pixelSize * 2,
painter.height,
),
backgroundPaint,
);
painter.paint(
canvas,
Offset(pixelSize * 8, 0),
);
}
}