Skip to content

ItxValidator offers a simple approach to field and object schema validation tailored for Flutter

License

Tahateber95/itx-validator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ItxValidator

ItxValidator a simple approach to field and object schema validation tailored for Flutter.

Getting Started

To begin with ItxValidator, define a schema object that represents the structure and validation rules for your data. Below is an example demonstrating how to create a schema for user data, including validations for email, password, and date fields.

Defining a Schema

Create a schema using ItxSchema.structure where each field in the data object is associated with an ItxValidator specifying its validation rules:

final ItxSchema formSchema = ItxSchema.structure(
  {
     "email": ItxValidator<String>()
      .required(message: 'Email is required')
      .email(message: 'Email is invalid'),
    "password": ItxValidator<String>().required(),
    'date': ItxValidator<num>().required()
  },
);

About

ItxValidator offers a simple approach to field and object schema validation tailored for Flutter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published