validator method
A function that must return a validation error if the provided
value
is invalid and null
otherwise.
Implementation
@override
ValidationError? validator(String? value) {
if (value == null || value.isEmpty || int.tryParse(value) == null) {
return ValidationError.invalid;
}
return null;
}