getTextPainter method
Implementation
TextPainter getTextPainter(text, color) {
if (color == null) color = style.colors.defaultText;
final tp = TextPainter(
text: TextSpan(text: "$text", style: getTextStyle(color)),
textDirection: TextDirection.ltr
);
tp.layout();
return tp;
}