customValidation static method

String? customValidation({
  1. UpCustomValidation? validation,
  2. required String value,
})

Implementation

static String? customValidation({
  UpCustomValidation? validation,
  required String value,
}) {
  final regex = RegExp(validation?.rejex ?? "");

  return value.isNotEmpty && !regex.hasMatch(value)
      ? validation?.message ?? ""
      : null;
}