getCountryFlagImgByIndex static method

Img? getCountryFlagImgByIndex({
  1. required int index,
})

Get the country flag for the specified index.

Parameters

  • IN index The country index

Returns

  • Country flag image if the index is valid, null othersise. The user is responsible to check if the image is valid

Throws

  • An exception if it fails.

Implementation

static Img? getCountryFlagImgByIndex({required final int index}) {
  final OperationResult resultString = objectMethod(
    0,
    'MapDetails',
    'getCountryFlagImgByIndex',
    args: index,
  );

  if (resultString['result'] == -1) {
    return null;
  }

  return Img.init(resultString['result']);
}