calcTextWidth static method
Implementation
static int calcTextWidth(TextPainter p, String? demoText) {
TextPainter painter = PainterUtils.create(
p, demoText, p.text!.style!.color, p.text!.style!.fontSize);
painter.layout();
return painter.width.toInt();
}