You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+24-25Lines changed: 24 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,13 @@
1
1
# Form Builder Validators
2
2
3
-
Form Builder Validators set of validators for any `FormField` widget or widgets that extend the `FormField` class - _e.g._, `TextFormField`, `DropdownFormField`, _et cetera_. It provides standard ready-made validation rules and a way to compose new validation rules combining multiple rules, including custom ones.
3
+
Form Builder Validators set of validators for any `FormField` widget or widgets that extend the `FormField` class - *e.g.*, `TextFormField`, `DropdownFormField`, *et cetera*. It provides standard ready-made validation rules and a way to compose new validation rules combining multiple rules, including custom ones.
4
4
5
5
Also included is the `l10n` / `i18n` of error text messages to multiple languages.
-[Modify the default error message in a specific language](#modify-the-default-error-message-in-a-specific-language)
29
28
-[Support](#support)
30
-
-[Contribute](#contribute)
31
-
-[Add new supported language](#add-new-supported-language)
32
-
-[Add new validator](#add-new-validator)
33
-
-[Questions and answers](#questions-and-answers)
34
-
-[Donations](#donations)
29
+
-[Contribute](#contribute)
30
+
- [Add new supported language](#add-new-supported-language)
31
+
- [Add new validator](#add-new-validator)
32
+
-[Questions and answers](#questions-and-answers)
33
+
-[Donations](#donations)
35
34
-[Roadmap](#roadmap)
36
35
-[Ecosystem](#ecosystem)
37
36
-[Thanks to](#thanks-to)
@@ -157,8 +156,8 @@ Validators support default `errorText` messages in these languages:
157
156
- Indonesian (id)
158
157
- Italian (it)
159
158
- Japanese (ja)
160
-
- Korean (ko)
161
159
- Kurdish (ku)
160
+
- Korean (ko)
162
161
- Khmer (km)
163
162
- Lao (lo)
164
163
- Malay (ms)
@@ -234,13 +233,13 @@ TextFormField(
234
233
validator: FormBuilderValidators.compose([
235
234
/// Makes this field required
236
235
FormBuilderValidators.required(),
237
-
236
+
238
237
/// Ensures the value entered is numeric - with a custom error message
239
238
FormBuilderValidators.numeric(errorText: 'La edad debe ser numérica.'),
240
-
239
+
241
240
/// Sets a maximum value of 70
242
241
FormBuilderValidators.max(70),
243
-
242
+
244
243
/// Include your own custom `FormFieldValidator` function, if you want
245
244
/// Ensures positive values only. We could also have used `FormBuilderValidators.min(0)` instead
246
245
(val) {
@@ -275,27 +274,27 @@ We welcome efforts to internationalize/localize the package by translating the d
275
274
276
275
1. Add ARB files
277
276
278
-
Create one ARB file inside the `lib/l10n` folder for each locale 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`.
277
+
Create one ARB file inside the `lib/l10n` folder for each locale 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`.
279
278
280
279
2. Translate the error messages
281
280
282
-
Copy and paste the contents of `intl_en.arb` into your newly created ARB file. Then translate the error messages by overwriting the default messages.
281
+
Copy and paste the contents of `intl_en.arb` into your newly created ARB file. Then translate the error messages by overwriting the default messages.
283
282
284
283
3. Generate localization code
285
284
286
-
To generate boilerplate code for localization, run the generate command inside the package directory where `pubspec.yaml` file is located:
285
+
To generate boilerplate code for localization, run the generate command inside the package directory where `pubspec.yaml` file is located:
287
286
288
-
`flutter gen-l10n`
287
+
`flutter gen-l10n`
289
288
290
-
The command will automatically create/update files inside the `lib/localization` directory, including your newly added locale support. The files in here are only necessary for local development and will not be committed to Github.
289
+
The command will automatically create/update files inside the `lib/localization` directory, including your newly added locale support. The files in here are only necessary for local development and will not be committed to Github.
291
290
292
291
4. Update README
293
292
294
-
Remember to update README, adding the new language (and language code) under [Supported languages section](#supported-languages) in alphabetic order, so that everyone knows your new language is now supported!
293
+
Remember to update README, adding the new language (and language code) under [Supported languages section](#supported-languages) in alphabetic order, so that everyone knows your new language is now supported!
295
294
296
295
5. Submit PR
297
296
298
-
Submit your PR and be of help to millions of developers all over the world!
297
+
Submit your PR and be of help to millions of developers all over the world!
299
298
300
299
#### Add new validator
301
300
@@ -328,4 +327,4 @@ Take a look at [our fantastic ecosystem](https://github.com/flutter-form-builder
0 commit comments