Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
deandreamatias authored Jul 31, 2024
1 parent 1d15895 commit df2439e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,8 @@ We welcome efforts to internationalize/localize the package by translating the d
#### Add new validator

1. Add a new validator to one of the folders in the `src` folder.
2. Implement it using the `BaseValidator` or `TranslatedValidator` class. Override the `validateValue` method and let the base class handle the null check in the `validate` method. When using a translation also override `translatedErrorText`.
3. Override the `translatedErrorText` property and return the correct translation from `FormBuilderLocalizations.current.`.
2. Implement it using the `BaseValidator` or `TranslatedValidator` class. Override the `validateValue` method and let the base class handle the null check in the `validate` method.
3. When using a `TranslatedValidator, Override the `translatedErrorText` property and return the correct translation from `FormBuilderLocalizations.current.`.
4. Make sure to pass `errorText` and `checkNullOrEmpty` to the base class.
5. Add static method to `form_builder_validators.dart` that uses the new validator.
6. Implement tests
Expand Down

0 comments on commit df2439e

Please sign in to comment.