Validator class abstract

Base class use to implement a validation

A Validator include a function validate to check value, and message to description invalid data and condition used to check context before run validate

Implementers

Constructors

Validator()

Properties

condition ↔ (bool Function()?)
Used to do some check context before run validate.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
message String?
Message used return when validate need return invalid state
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
validate(dynamic value) FutureOr<String?>
Do check value, return text if value is invalid, otherwise is null

Operators

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

Static Properties

registered Map<String, ValidatorRegister>
cached all registered validators
no setter

Static Methods

convert(Map<String, dynamic> map) Validator?
Convert a Map to a Validator, there are only one element in Map. Use 'all' or 'least' to combine multi validators.
convertMulti(dynamic val) List<Validator>
Return to list Validators from a Map or List