AnyValidator class

Succeeds if at least one child validator succeeds. Fails if all fail.

Inheritance
Available extensions

Constructors

AnyValidator(Iterable<IValidator> validators, {bool nullable = false, bool optional = false, String? message})

Properties

hashCode int
The hash code for this object.
no setterinherited
isNullable bool
finalinherited
isOptional bool
finalinherited
message String?
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
validators Iterable<IValidator>
finalinherited

Methods

copyWith({bool? nullable, bool? optional, Iterable<IValidator>? validators, String? message}) AnyValidator
override
isNotValid(dynamic value) bool
inherited
isNotValidAsync(dynamic value) FutureOr<bool>
inherited
isValid(dynamic value) bool
inherited
isValidAsync(dynamic value) FutureOr<bool>
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
nullable<T>() IValidator
inherited
optional<T>() IValidator
inherited
toString() String
A string representation of this object.
inherited
validate(dynamic value, {bool exists = true}) Result
inherited
validateAsync(dynamic value, {bool exists = true}) Future<Result>
inherited
validateOrThrow(dynamic value) Result
inherited
validator(dynamic value) FutureOr<Result>
inherited

Operators

operator &(IValidator other) IValidator

Available on IValidator, provided by the EskemaEskValidatorOperations extension

Combines two validators with a logical AND, same as using all
operator ==(Object other) bool
The equality operator.
inherited
operator >(Expectation error) IValidator

Available on IValidator, provided by the EskemaEskValidatorOperations extension

Returns a new validator that will return the error message if the validation fails
operator |(IValidator other) IValidator

Available on IValidator, provided by the EskemaEskValidatorOperations extension

Combines two validators with a logical OR, same as using any