getCountryData static method

CountryData getCountryData(
  1. int id
)

Get country data for the specified country ID.

Parameters

  • IN id The country ID

Returns

  • The country data

Throws

  • An exception if it fails.

Implementation

static CountryData getCountryData(final int id) {
  final OperationResult resultString = objectMethod(
    0,
    'MapDetails',
    'getCountryData',
    args: id,
  );

  if (resultString['result']['image'] == -1) {
    return CountryData(
        name: resultString['result']['name'],
        isoCode: resultString['result']['iso']);
  }

  final Img image = Img.init(resultString['result']['image']);

  return CountryData(
      name: resultString['result']['name'],
      isoCode: resultString['result']['iso'],
      flagImage: image);
}