form_validators 0.0.3 copy "form_validators: ^0.0.3" to clipboard
form_validators: ^0.0.3 copied to clipboard

outdated

A basic validation for flutter forms.

Form Validator #

A library to validate form fields for Flutter framework

This library only for flutter framework.

to use the JS-based please see Web form validators

Contributors #

Any help is welcomed

Validators #

Here is a list of the validators currently available.

Validator | Description

------------------------------------------------------- | --------------------------------------

Contains(seed, [message]) | check if the string contains the seed.

Equals(seed, [message]) | check if the field value equal to a certain string

Required([message]) | Mark the field is required.

MaxLength(limit, [message]) | Set the maximum amount of character.

MinLength(limit, [message]) | Set the minimum amount of character.

Between(this.message, {int max, int min}) | Limit the field digits to be between limited range

it use MaxLength and MinLength validators.

the message argument is required here

Composs(this.message, this.validators) | Composs multiple validator into one singular validator.

the message argument is required here

Email([this.message, regexp]) | Indicate that the field should be an email

It uses a common regexp to validate the string, but you can use your own

the regexp is r"^[a-zA-Z0-9.]+@[a-zA-Z0-9]+\.[a-zA-Z]+"]

Pattern(pattern, [this.message]) | check if the field value matches the pattern.

Contributing #

In general, we follow the "fork-and-pull" Git workflow.

  1. Fork the repo on GitHub

  2. Clone the project to your own machine

  3. Work on your fork

  4. Make your changes and additions

  5. Change or add tests if needed

  6. Run tests and make sure they pass (No test yet)

  7. Add changes to README.md if needed

  8. Commit changes to your own branch

  9. Make sure you merge the latest from "upstream" and resolve conflicts if there is any

  10. Repeat step 3(3) above

  11. Push your work back up to your fork

  12. Submit a Pull request so that we can review your changes

Maintainers #

Made with love #

This lib inspired by

https://www.npmjs.com/package/validator

2
likes
0
pub points
40%
popularity

Publisher

unverified uploader

A basic validation for flutter forms.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on form_validators