Country.code2Letters constructor

Country.code2Letters(
  1. String code2Letters,
  2. String namel10n
)

Implementation

factory Country.code2Letters(String code2Letters, String namel10n) {
  if (code2Letters.isNotEmpty &&
      countriesFrench.keys.any((element) => element == code2Letters) ==
          false) {
    print('$code2Letters unknown country code');
    throw 'unknown country code';
  } else if (code2Letters.isEmpty) {
    return Country.empty;
  } else {
    return Country._(code2Letters, namel10n);
  }
}