resolveAutoResizeTextForMeasure static method

String resolveAutoResizeTextForMeasure(
  1. String text,
  2. int? maxLength
)

Truncates the measured text when maxLength is positive.

Implementation

static String resolveAutoResizeTextForMeasure(String text, int? maxLength) =>
    (maxLength != null && maxLength > 0) && text.length > maxLength
        ? text.substring(0, maxLength)
        : text;