validate method
Implementation
String? validate() {
if (hasError) {
return error;
}
if (isRequired && isNull) {
return "Field $name is required";
}
return null;
}
String? validate() {
if (hasError) {
return error;
}
if (isRequired && isNull) {
return "Field $name is required";
}
return null;
}