validator method
Implementation
String? validator(String? newValue) {
try {
try {
validate(newValue);
return null;
} on InvalidValueException<dynamic> catch (e) {
return e.toString();
} on RequiredValueException catch (_) {
return "Campo obrigatório";
} catch (e) {
return "Erro ao atribuir $newValue a $runtimeType";
}
} on InvalidValueException<dynamic> catch (e) {
return e.toString();
} catch (e) {
return "Erro não identificado ao atribuir $newValue a $runtimeType";
}
}