getSize method
Calculates the size of the rendered object.
Implementation
@override
Size getSize({double minWidth = 0.0, double maxWidth = double.infinity}) {
// Generate the text as a visual layout
textPainter.layout(minWidth: minWidth, maxWidth: maxWidth * scale);
return textPainter.size;
}