convertCountryListToString method
Implementation
String convertCountryListToString(String countryCodes) {
if (countryCodes.isEmpty) return "";
// Map the list into the required format
String result = countryCodes.split(",").map((code) => 'country:$code').join('|');
return result;
}