EzValidator<T> class

Available Extensions

Constructors

EzValidator({bool optional = false, T? defaultValue, String? label})

Properties

defaultValue → T?
default is used when casting produces a null output value
final
hashCode int
The hash code for this object.
no setterinherited
label String?
Overrides the key name which is used in error messages.
final
optional bool
optional by default is False if optional True the required validation will be ignored
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
transformationFunction ↔ (T Function(T)?)
transformation function this function will be called before any validation it can be used to transform the value before validation for example: trim a string or parse a string to a DateTime or cast a String to int ....
getter/setter pair
validations List<ValidationCallback<T>>
final

Methods

addValidation(ValidationCallback<T> validator) EzValidator<T>
build() ValidationCallback<T>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
validate(T? value, [Map? entireData]) → dynamic
Global validators

Operators

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

Static Properties

globalLocale EzLocale
getter/setter pair

Static Methods

setLocale(EzLocale locale) → void
set custom locale