validateValue method
Validates the value.
Returns null if the value is valid, otherwise an error message.
Call validate() instead of this method when using the validator.
Implementation
@override
String? validateValue(T valueCandidate) {
  final num? value;
  if (valueCandidate is String) {
    value = num.tryParse(valueCandidate);
  } else if (valueCandidate is num) {
    value = valueCandidate;
  } else {
    return errorText;
  }
  if (value == null || (value < min || value > max)) {
    return errorText;
  }
  return null;
}