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
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -382,8 +382,8 @@ We welcome efforts to internationalize/localize the package by translating the d
382
382
#### Add new validator
383
383
384
384
1. Add a new validator to one of the folders in the `src` folder.
385
-
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`.
386
-
3. Override the `translatedErrorText` property and return the correct translation from `FormBuilderLocalizations.current.`.
385
+
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.
386
+
3.When using a `TranslatedValidator, Override the `translatedErrorText` property and return the correct translation from `FormBuilderLocalizations.current.`.
387
387
4. Make sure to pass `errorText` and `checkNullOrEmpty` to the base class.
388
388
5. Add static method to `form_builder_validators.dart` that uses the new validator.
0 commit comments