getLocationTitle static method
Implementation
static String? getLocationTitle(Location? location) {
if (location == null) {
return null;
}
final StringBuffer result = StringBuffer();
final String? countryEmoji = EmojiHelper.getCountryEmoji(
_getCountry(location),
);
if (location.name != null) {
result.write(location.name);
}
if (location.city != null) {
if (result.isNotEmpty) {
result.write(', ');
}
result.write(location.city);
}
if (countryEmoji != null) {
if (result.isNotEmpty) {
result.write(' ');
}
result.write(countryEmoji);
}
if (result.isEmpty) {
return null;
}
return result.toString();
}