isoCountryForCodeForLocale static method
Future<Country>
isoCountryForCodeForLocale(
- dynamic countryCode, {
- dynamic localeIdentifier = '',
Function to get a single country data for the country code and locale identifier passed in If no valid country found, then you will get an empty hash map Optional localeIdentifier, if the identifier is not provided, then current locale is used
Implementation
static Future<Country> isoCountryForCodeForLocale(countryCode,
{localeIdentifier = ''}) async {
final countryMap = await _channel.invokeMethod(
'getCountryForCountryCodeWithLocaleIdentifier',
{'countryCode': countryCode, 'locale_identifier': localeIdentifier});
// Parse
final Country country = Country(
name: countryMap['name'], countryCode: countryMap['countryCode']);
return country;
}