getCode method
Return the country code corresponding to the country name given.
If the country name is given, but it is not found in the list of known countries,
this method will throw an exception.
Implementation
String getCode(String ctryname) {
final String jscode =
'new Country({locale: "$locale"}).getCode("$ctryname")';
try {
final String result = ILibJS.instance.evaluate(jscode).stringResult;
return result;
} catch (e) {
throw ArgumentError('Country $ctryname is unknown');
}
}