MaxLengthRule constructor

const MaxLengthRule(
  1. int maxLength, {
  2. String? message,
})

Creates a maximum length validation rule. maxLength is the maximum allowed number of characters. message is the optional error message.

Implementation

const MaxLengthRule(this.maxLength, {String? message})
    : message = message ?? 'Value cannot exceed $maxLength characters.';