hasTextOverflow function

bool hasTextOverflow(
  1. String text,
  2. TextStyle style,
  3. double width,
  4. {int maxLines = 1}
)

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;
}