CustomValidator<I> class

Custom validator. Allows to define validation with CustomValidator.isValid callback.

Can be defined or with field name and error message within default constructor or with CustomValidator.message callback to generate error message during the validation

Implemented types

Constructors

CustomValidator({required _MessageBuilder<I> message, required _Validator<I> isValid, String? fieldName, bool ignoreNullable = true})
CustomValidator.withMessage({required _MessageBuilder<I> message, required _Validator<I> isValid, bool ignoreNullable = true})
const

Properties

hashCode int
The hash code for this object.
no setterinherited
ignoreNullable bool
If validation can be invoked on null values.
final
isValid → _Validator<I>
Validation method
final
message → _MessageBuilder<I>
Validation message callback
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

call(I? value) String?
Invoke validation
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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