menu
ez_validator package
documentation
ez_validator.dart
EzValidator<T> class
EzValidator<T> class
dark_mode
light_mode
EzValidator<
T
>
class
Available Extensions
BooleanValidatorExtensions
CommonValidatorExtensions
DateValidatorExtensions
ListValidatorExtensions
NumValidatorExtensions
SchemaValidation
StringValidatorExtensions
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 setter
inherited
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 setter
inherited
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
ez_validator package
documentation
ez_validator
EzValidator<T> class
ez_validator library