EasyValidate class
Adiciona regras de validação customizadas para um campo, que serão
verificadas pelos métodos validate e fromJsonSafe.
Constructors
- EasyValidate({int? minLength, int? maxLength, String? regex, num? min, num? max, EasyFormat? format, bool? past, bool? future, Function? custom})
-
const
Properties
- custom → Function?
-
Uma função de validação customizada.
A função deve ser estática ou de nível superior, receber um argumento
do tipo do campo e retornar
bool.final - format → EasyFormat?
-
Para
String: um formato pré-definido que o valor deve corresponder.final - future → bool?
-
Para
DateTime: o valor deve ser uma data no futuro.final - hashCode → int
-
The hash code for this object.
no setterinherited
- max → num?
-
Para
num(int/double): o valor máximo permitido (inclusivo).final - maxLength → int?
-
Para
String: comprimento máximo. ParaList/Set/Map: número máximo de elementos.final - min → num?
-
Para
num(int/double): o valor mínimo permitido (inclusivo).final - minLength → int?
-
Para
String: comprimento mínimo. ParaList/Set/Map: número mínimo de elementos.final - past → bool?
-
Para
DateTime: o valor deve ser uma data no passado.final - regex → String?
-
Para
String: um padrão de expressão regular que o valor deve corresponder.final - 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
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited