LengthValidator<T> class

Validator that checks string length.

Inheritance

Constructors

LengthValidator({int? min, int? max, int? exact})

Properties

customErrorMessage String?
Custom error message override.
getter/setter pairinherited
defaultErrorMessage String
The default error message for this validator.
no setteroverride
exact int?
final
hashCode int
The hash code for this object.
no setterinherited
max int?
final
min int?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getErrorMessage(ValidationContext<T> context, String? value) String
Gets the error message for this validator.
inherited
isValid(ValidationContext<T> context, String? value) bool
Determines if the value is valid.
override
isValidAsync(ValidationContext<T> context, String? value) Future<bool>
Determines if the value is valid asynchronously.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
validate(ValidationContext<T> context, String? value, String propertyName) List<ValidationFailure>
Validates the property value.
inherited
validateAsync(ValidationContext<T> context, String? value, String propertyName) Future<List<ValidationFailure>>
Validates the property value asynchronously.
inherited

Operators

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