customLengthFormatter static method

List<TextInputFormatter> customLengthFormatter(
  1. int maxLength
)

customLengthFormatter limits input to a specified maximum length.

Implementation

static List<TextInputFormatter> customLengthFormatter(int maxLength) {
  return [
    LengthLimitingTextInputFormatter(maxLength),
  ];
}