Skip to content

Commit 5bb2a7e

Browse files
committed
Add changelog and changes in readme
1 parent 02eaed6 commit 5bb2a7e

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
- Re-land generated l10n files
1010
- Add Bulgarian
1111

12+
### Breaking changes
13+
14+
- See Readme: <https://github.com/flutter-form-builder-ecosystem/form_builder_validators?tab=readme-ov-file#v10-to-v11>
15+
1216
### New validators
1317

1418
- Add creditCardExpirationDate

README.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Also included is the `l10n` / `i18n` of error text messages to multiple language
2828
- [Modify the default error message in a specific language](#modify-the-default-error-message-in-a-specific-language)
2929
- [Migrations](#migrations)
3030
- [v7 to v8](#v7-to-v8)
31+
- [v10 to 11](#v10-to-v11)
3132
- [Support](#support)
3233
- [Contribute](#contribute)
3334
- [Add new supported language](#add-new-supported-language)
@@ -314,6 +315,11 @@ see [override_form_builder_localizations_en](example/lib/override_form_builder_l
314315

315316
## Migrations
316317

318+
### v10 to v11
319+
320+
- 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.
321+
- `dateString()` changed to `date()` for constancy in api naming. Simply change the name to fix the code.
322+
317323
### v7 to v8
318324

319325
Remove `context` as a parameter to validator functions. For example, `FormBuilderValidators.required(context)` becomes `FormBuilderValidators.required()` without `context` passed in.
@@ -360,14 +366,19 @@ We welcome efforts to internationalize/localize the package by translating the d
360366

361367
#### Add new validator
362368

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:
369+
1. Add a new validator to one of the folders in the `src` folder.
370+
2. Implement it using the `BaseValidator` class. Override the `validateValue` method and let the base class handle the null check in the `validate` method.
371+
3. Override the `translatedErrorText` property and return the correct translation from `FormBuilderLocalizations.current.`.
372+
4. Make sure to pass `errorText` and `checkNullOrEmpty` to the base class.
373+
5. Add static method to `form_builder_validators.dart` that uses the new validator.
374+
6. Implement tests
375+
7. Add to [validators](#validators) with name and description
376+
8. Add message error translated on all languages (yes, all languages). To accomplish this need:
367377
a. Add property to all `intl_*.arb` files, in alphabetic order.
368378
b. Translate message in all languages.
369379
c. Run `flutter gen-l10n` command
370-
5. Submit PR
380+
9. Run dart `dart fix --apply` and `dart format .`
381+
10. Submit PR
371382

372383
### Questions and answers
373384

0 commit comments

Comments
 (0)