cut method

String cut([
  1. int maxLength = 10,
  2. bool withDots = true
])

Implementation

String cut([int maxLength = 10, bool withDots = true]) => this == null
    ? value
    : count < maxLength
        ? value
        : '${this?.substring(0, maxLength)}${withDots ? '...' : ''}';