validator property

EasyFormFieldValidator<T>? validator
final

An optional method that validates an input. Returns an error string to display if the input is invalid, or null otherwise.

The returned value is exposed by the EasyFormFieldState.errorText property. The EasyTextFormField uses this to override the InputDecoration.errorText value.

Alternating between error and normal state can cause the height of the EasyTextFormField to change if no other subtext decoration is set on the field. To create a field whose height is fixed regardless of whether or not an error is displayed, either wrap the EasyTextFormField in a fixed height parent like SizedBox, or set the InputDecoration.helperText parameter to a space.

Implementation

final EasyFormFieldValidator<T>? validator;