inputValidator method
Implementation
String? inputValidator(String? value) {
if (value == null || value.isEmpty) {
return emptyFieldErrorMessage;
} else if (widget.formType == FormType.email &&
!RegExp(r'^[^@]+@[^@]+\.[^@]+').hasMatch(value)) {
return invalidFormErrorMessage;
} else if (widget.formType == FormType.password && value.length < 6) {
return invalidFormErrorMessage;
}
return null;
}