textWidth function
Gets the width of a text
with a given style
.
Optionally maxLines
can be provided to check overflow on text with more than one line, otherwise it defaults to 1.
See also:
Implementation
double textWidth(String text, TextStyle style, {int maxLines = 1}) =>
_textPainter(text, style, maxLines).width;