getSubtitle method

String? getSubtitle()

Returns a typical ListTile subtitle text, or null if empty.

Implementation

String? getSubtitle() {
  final StringBuffer result = StringBuffer();
  if (city != null) {
    result.write(city);
  }
  if (postcode != null) {
    if (result.isNotEmpty) {
      result.write(', ');
    }
    result.write(postcode);
  }
  if (country != null) {
    if (result.isNotEmpty) {
      result.write(', ');
    }
    result.write(country);
  }
  if (osmKey != null && osmValue != null) {
    if (result.isNotEmpty) {
      result.write(', ');
    }
    result.write('$osmKey:$osmValue');
  }
  if (result.isEmpty) {
    return null;
  }
  return result.toString();
}