MaxLengthRule class

Validates that a field's value does not exceed a maximum length.

Implemented types
Annotations

Constructors

MaxLengthRule.new(int maxLength, {String? message})
Creates a maximum length validation rule. maxLength is the maximum allowed number of characters. message is the optional error message.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
maxLength int
final
message 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, {BuildContext? context}) String?
Validates the given value. Returns an error message String if validation fails, otherwise returns `null].
override

Operators

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