nelfs75gb / validatorless

Validatorless - A Flutter package for validate entries

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Validatorless

This package provides a means to validate text inputs on the flutter and was inspired by Yup

Validatorless in pub.dev

how to use

dependencies:
  validatorless:
TextFormField(
  decoration: InputDecoration(
    labelText: 'User e-mail',
  ),
  validator: Validatorless.multiple([
     Validatorless.email('The field must be an email'),
     Validatorless.required('The field is obligatory')
   ]),
)

or use

TextFormField(
  decoration: InputDecoration(
    labelText: 'CPF',
  ),
  validator: 
     Validatorless.cpf('CPF not is valid'),
)

Validatorless functions

 Validatorless.required(String)
 Validatorless.email(String)
 Validatorless.min(Number, String)
 Validatorless.max(Number, String)
 Validatorless.number(String)
 Validatorless.cpf(String) 
 Validatorless.cnpj(String) 

About

Validatorless - A Flutter package for validate entries

License:MIT License


Languages

Language:Dart 100.0%