PredicateValidator<T, TProperty> class

Validator that uses a custom predicate function.

Inheritance

Constructors

PredicateValidator(bool predicate(TProperty?), String errorMessage)

Properties

customErrorMessage String?
Custom error message override.
getter/setter pairinherited
defaultErrorMessage String
The default error message for this validator.
no setteroverride
errorMessage String
final
hashCode int
The hash code for this object.
no setterinherited
predicate bool Function(TProperty?)
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getErrorMessage(ValidationContext<T> context, TProperty? value) String
Gets the error message for this validator.
inherited
isValid(ValidationContext<T> context, TProperty? value) bool
Determines if the value is valid.
override
isValidAsync(ValidationContext<T> context, TProperty? 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, TProperty? value, String propertyName) List<ValidationFailure>
Validates the property value.
inherited
validateAsync(ValidationContext<T> context, TProperty? value, String propertyName) Future<List<ValidationFailure>>
Validates the property value asynchronously.
inherited

Operators

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