convertCountryIso static method
- String code,
- ISOCodeType type
Converts a country ISO code between ISO-2 and ISO-3 formats.
Converts the provided country code to the requested type. The input
may be either a two-letter or three-letter code; the method returns the
matching value in the requested format. If the input is not recognized the
result will follow the SDK's standard behavior for unknown codes (for
example an empty string or an unmodified value).
Parameters
code: The country ISO code to convert. Can be in ISO-2 or ISO-3 form.type: The target ISOCodeType for the converted code.
Returns
- A String containing the converted country ISO code.
Also see:
- convertLanguageIso - For converting language ISO codes.
Implementation
static String convertCountryIso(String code, ISOCodeType type) {
final OperationResult resultString = staticMethod(
'ISOCodeConversions',
'convertCountryIso',
args: <String, dynamic>{'code': code, 'type': type.id},
);
final String result = resultString['result'];
return result;
}