check method

bool check(
  1. String value
)

Implementation

bool check(String value) {
  switch (this) {
    case CheckableFormat.email:
      // Email validation logic
      return RegExp(r'^[\w+.-]+@[\w-]+(\.[\w-]+)+$').hasMatch(value);

    case CheckableFormat.website:
      // Email validation logic
      return RegExp(r'^(https?:\/\/)?(www\.)?([a-zA-Z0-9-]{1,63}\.)+[a-zA-Z]{2,6}(:[0-9]{1,5})?(\/.*)?$').hasMatch(value);

    case CheckableFormat.phoneNumber:
      // Phone number validation logic
      // This is a simple example and might not cover all cases
      return RegExp(r'^\d{10}$').hasMatch(value);

    case CheckableFormat.sirenNumber:
      // SIREN number validation logic
      // This is a simple example and might not cover all cases
      return RegExp(r'^\d{9}$').hasMatch(value);
    case CheckableFormat.siret:
      // SIREN number validation logic*
      // This is a simple example and might not cover all cases
      return RegExp(r'^\d{14}$').hasMatch(value);

    case CheckableFormat.year:
      // SIREN number validation logic
      // This is a simple example and might not cover all cases
      return RegExp(r'^[12]\d{3}$').hasMatch(value);
  }
}