MaxLengthValidator class

MaxLengthValidator checks the maximum length of a string.

Implemented types

Constructors

MaxLengthValidator.new(int maxLength, {String? customErrorMessage})

Properties

customErrorMessage String?
The custom error message for this validator.
final
defaultErrorMessage String
The default error message for this validator. Can be overridden when creating an instance of the validator.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
maxLength int
The maximum length of the string.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
validate(String? value) String?
Takes the current value of the field Returns a string with the error message if the value is invalid, otherwise null.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited