forceErrorText property

String? forceErrorText
final

An optional property that forces the FormFieldState into an error state by directly setting the FormFieldState.errorText property without running the validator function.

When the forceErrorText property is provided, the FormFieldState.errorText will be set to the provided value, causing the form field to be considered invalid and to display the error message specified.

When validator is provided, forceErrorText will override any error that it returns. validator will not be called unless forceErrorText is null.

See also:

Implementation

final String? forceErrorText;