validate method
Validates the value and checks if it is null or empty.
Implementation
String? validate(T? valueCandidate) {
final bool isNullOrEmpty = this.isNullOrEmpty(valueCandidate);
if (checkNullOrEmpty && isNullOrEmpty) {
return errorText;
} else if (!checkNullOrEmpty && isNullOrEmpty) {
return null;
} else {
return validateValue(valueCandidate as T);
}
}