maybeHandleOverflow method

String maybeHandleOverflow({
  1. int? maxChars,
  2. String replacement = '',
})

Implementation

String maybeHandleOverflow({int? maxChars, String replacement = ''}) =>
    maxChars != null && length > maxChars
        ? replaceRange(maxChars, null, replacement)
        : this;