DEV Community


Discussion on: Why use Reactive Forms in Flutter?

joanpablo profile image
Joan Pablo Author • Edited

Hi John Lester,

You can add a ControlValueAccessor to the reactive text field with the format.
In the Wiki you have an example of how to do that.

To add a validation message you just supply the validationMessages callback method in ReactiveTextField and return a Map with the messages:

   formControlName: 'email',
   validationMessages: (control) => {
      ValidationMessage.required: 'The email must not be empty', 'The email value must be a valid email'
Enter fullscreen mode Exit fullscreen mode
Forem Open with the Forem app