Validations class

Constructors

Validations()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

cnpj(String? value, {String error = 'CNPJ inválido'}) String?
use to validate cnpj fields
compare(String? value, {String compareTo = '', String error = 'Compo inválido'}) String?
compare two fields such as password and password confirmation
cpf(String? value, {String error = 'CPF inválido'}) String?
use to validate cpf fields
cpfOrCnpj(String? value, {String errorCPF = 'CPF inválido', String errorCNPJ = 'CNPJ inválido'}) String?
use to validate cpfOrCnpj fields
date(String? value, {String error = 'Data inválida', DateTime? min, DateTime? max}) String?
use to validate date fields
email(String? value, {String error = 'Email inválido'}) String?
use to validate email fields
generic(String? value, {String error = 'Campo inválido', int min = 1}) String?
use to validate generic fields
money(String? value, {String error = 'Valor inválido', double min = 1, int decimalLength = 2}) String?
use to validate money fields
multiple({required List<String?> validations}) String?
use to apply multiple validations
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
phone(String? value, {String error = 'Telefone inválido'}) String?
toString() String
A string representation of this object.
inherited

Operators

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