validator property

(String? Function(DateTime? value)?) validator
final

The validator passed to the text input. Returns a string containing an error message.

By default, the form field checks for if the date is within minDate and maxDate (if given). It also checks for null values unless requirementLevel is set to ZetaFormFieldRequirement.optional

If the default validation fails, errorText will be shown. However, if validator catches any of these conditions, the return value of validator will be shown.

Implementation

final String? Function(DateTime? value)? validator;