form_validators 0.0.3 form_validators: ^0.0.3 copied to clipboard
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.
-
Fork the repo on GitHub
-
Clone the project to your own machine
-
Work on your fork
-
Make your changes and additions
-
Change or add tests if needed
-
Run tests and make sure they pass (No test yet)
-
Add changes to README.md if needed
-
Commit changes to your own branch
-
Make sure you merge the latest from "upstream" and resolve conflicts if there is any
-
Repeat step 3(3) above
-
Push your work back up to your fork
-
Submit a Pull request so that we can review your changes
Maintainers #
- ezzabuzaid - (author)