findMetadataForCountryCode static method

Map<String, dynamic>? findMetadataForCountryCode(
  1. String countryCode,
  2. String nationalNumber
)

Implementation

static Map<String, dynamic>? findMetadataForCountryCode(
  String countryCode,
  String nationalNumber,
) {
  final isoList = countryCodeToIsoCode(countryCode);

  if (isoList.isEmpty) {
    return null;
  }
  // country code can have multiple metadata because multiple iso code
  // share the same country code.
  final allMatchingMetadata =
      isoList.map((iso) => findMetadataForIsoCode(iso)).toList();

  final match = _getMatchUsingPatterns(nationalNumber, allMatchingMetadata);
  return match;
}