hasTextOverflow function
Determines if text
will overflow in a given width
.
Optionally maxLines
can be provided to check overflow on text with more than one line, otherwise it defaults to 1.
See also:
Implementation
bool hasTextOverflow(String text, TextStyle style, double width, {int maxLines = 1}) {
final TextPainter textPainter = _textPainter(text, style, maxLines, width);
return textPainter.didExceedMaxLines;
}