isPostalCode function

bool isPostalCode(
  1. String? text,
  2. String locale,
  3. {bool orElse(
      )?}
    )

    Implementation

    bool isPostalCode(String? text, String locale, {bool orElse()?}) {
      final pattern = _postalCodePatterns[locale];
      return pattern != null
          ? pattern.hasMatch(text!)
          : orElse != null
              ? orElse()
              : throw FormatException();
    }