getSiGunGuNameFromCode function

String getSiGunGuNameFromCode({
  1. required String siDo,
  2. required String code,
  3. String languageCode = 'ko',
})

Returns the name of the Si/Gun/Gu area code from the code.

If somehow the code is not found, it throws an exception.

Implementation

String getSiGunGuNameFromCode(
    {required String siDo, required String code, String languageCode = 'ko'}) {
  List<AreaCode> siGunGuCodes =
      getSiGunGuCodes(languageCode: languageCode, siDo: siDo);

  AreaCode siGunGu = siGunGuCodes.firstWhere(
    (address) => address.code == code,
  );
  return siGunGu.name;
}