exceedsMaxLines method

bool exceedsMaxLines(
  1. TextStyle textStyle,
  2. BoxConstraints size
)

Implementation

bool exceedsMaxLines(TextStyle textStyle, BoxConstraints size) {
  final span = TextSpan(text: text, style: textStyle);

  final tp = TextPainter(
    maxLines: maxLines,
    textAlign: textAlign,
    textDirection: TextDirection.ltr,
    text: span,
  );

  tp.layout(maxWidth: size.maxWidth);

  return tp.didExceedMaxLines;
}