DEV Community 👩‍💻👨‍💻

Discussion on: Star Rating with Flutter Reactive Forms

joanpablo profile image
Joan Pablo Author • Edited on

There you have an InputDecoration. You should avoid using validator, and instead use the errorText of the decoration. You can search for the implementation of the ReactiveTextField to see how it is using this approach.

builder: (ReactiveFormFieldState field) {
   final state = field as _ReactiveTextFieldState;
   final InputDecoration effectiveDecoration = (decoration ?? const InputDecoration())

   return DateTimePicker(
      decoration: effectiveDecoration.copyWith(errorText: state.errorText),

Enter fullscreen mode Exit fullscreen mode

In the above code, I'm not using your RDateTimePicker just to simplify things, but it also applies with your wrapper widget.

Thread Thread
inmer profile image

Thank you, Joan finally I was able to make it work for both cases, greatly appreciate your help.