callFunction static method

String? callFunction(
  1. ValidatorType type,
  2. String? value
)

Calls the appropriate validator based on type.

Implementation

static String? callFunction(ValidatorType type, String? value) {
  switch (type) {
    case ValidatorType.email:
      return validateEmail(value);
    case ValidatorType.password:
      return validatePassword(value);
    case ValidatorType.name:
      return validateName(value);
    case ValidatorType.mobile:
      return validateMobile(value);
  }
}