IValidator class abstract

Immutable base class from which all validators inherit.

Implementers
Available extensions

Constructors

IValidator({bool nullable = false, bool optional = false})
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
isNullable → bool
final
isOptional → bool
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

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

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