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
-`FormBuilderValidator.log()` - Logs the value during the validation process.
184
199
-`FormBuilderValidator.withErrorMessage()` - Overrides the error message of the current validator.
185
200
186
-
###Supported languages
201
+
## Supported languages
187
202
188
203
Validators support default `errorText` messages in these languages:
189
204
@@ -314,6 +329,11 @@ see [override_form_builder_localizations_en](example/lib/override_form_builder_l
314
329
315
330
## Migrations
316
331
332
+
### v10 to v11
333
+
334
+
- All validators now first check for null or empty value and return an error if so. You can set `checkNullOrEmpty` to `false` if you want to avoid this behavior.
335
+
-`dateString()` changed to `date()` for constancy in api naming. Simply change the name to fix the code.
336
+
317
337
### v7 to v8
318
338
319
339
Remove `context` as a parameter to validator functions. For example, `FormBuilderValidators.required(context)` becomes `FormBuilderValidators.required()` without `context` passed in.
@@ -360,14 +380,19 @@ We welcome efforts to internationalize/localize the package by translating the d
360
380
361
381
#### Add new validator
362
382
363
-
1. Add method to `validators.dart` with your Dart documentation
364
-
2. Implement tests
365
-
3. Add to [validators](#validators) with name and description
366
-
4. Add message error translated on all languages (yes, all languages). To accomplish this need:
383
+
1. Add a new validator to one of the folders in the `src` folder.
384
+
2. Implement it using the `BaseValidator` class. Override the `validateValue` method and let the base class handle the null check in the `validate` method.
385
+
3. Override the `translatedErrorText` property and return the correct translation from `FormBuilderLocalizations.current.`.
386
+
4. Make sure to pass `errorText` and `checkNullOrEmpty` to the base class.
387
+
5. Add static method to `form_builder_validators.dart` that uses the new validator.
388
+
6. Implement tests
389
+
7. Add to [validators](#validators) with name and description
390
+
8. Add message error translated on all languages (yes, all languages). To accomplish this need:
367
391
a. Add property to all `intl_*.arb` files, in alphabetic order.
368
392
b. Translate message in all languages.
369
393
c. Run `flutter gen-l10n` command
370
-
5. Submit PR
394
+
9. Run dart `dart fix --apply` and `dart format .`
0 commit comments