Skip to content

Commit c73677b

Browse files
committed
Documented the new Validators
1 parent bc6452c commit c73677b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Also included is the `l10n` / `i18n` of error text messages to multiple language
4040
## Validators
4141

4242
This package comes with several most common `FormFieldValidator`s such as required, numeric, mail,
43-
URL, min, max, minLength, maxLength, IP, credit card, etc., with default `errorText` messages.
43+
URL, min, max, minLength, maxLength, minWordsCount, maxWordsCount, IP, credit card, etc., with default `errorText` messages.
4444

4545
Available built-in validators include:
4646

@@ -53,8 +53,10 @@ Available built-in validators include:
5353
- `FormBuilderValidators.match()` - requires the field's value to match the provided regex pattern.
5454
- `FormBuilderValidators.max()` - requires the field's value to be less than or equal to the provided number.
5555
- `FormBuilderValidators.maxLength()` - requires the length of the field's value to be less than or equal to the provided maximum length.
56+
- `FormBuilderValidators.maxWordsCount()` - requires the words count of the field's value to be less than or equal to the provided maximum count.
5657
- `FormBuilderValidators.min()` - requires the field's value to be greater than or equal to the provided number.
5758
- `FormBuilderValidators.minLength()` - requires the length of the field's value to be greater than or equal to the provided minimum length.
59+
- `FormBuilderValidators.minWordsCount()` - requires the words count of the field's value to be greater than or equal to the provided minimum count.
5860
- `FormBuilderValidators.equalLength()` - requires the length of the field's value to be equal to the provided minimum length.
5961
- `FormBuilderValidators.numeric()` - requires the field's value to be a valid number.
6062
- `FormBuilderValidators.required()` - requires the field have a non-empty value.
@@ -186,7 +188,7 @@ See [contribution file](https://github.com/flutter-form-builder-ecosystem/.githu
186188

187189
We especially welcome efforts to internationalize/localize the package by translating the default validation `errorText` strings for built-in validation rules.
188190

189-
1. Add ARB files
191+
1. Add ARB files
190192

191193
Create one ARB file inside the `lib/l10n` folder for each of the locales you need to add support. Name the files in the following way: `intl_<LOCALE_ISO_CODE>.arb`. For example: `intl_fr.arb` or `intl_fr_FR.arb`.
192194

0 commit comments

Comments
 (0)