validator property
String? Function(T? value)?
get
validator
validator A function that validates the input value.
By default, this returns null, indicating that there is no validation.
Example:
@override
String? Function(MyEnum? value)? get validator => (value) {
if (value == null) {
return 'Please select an option';
}
return null; // Valid input
};
Implementation
String? Function(T? value)? get validator => null;