getComponent static method

String? getComponent(
  1. Placemark place,
  2. String type
)

Implementation

static String? getComponent(Placemark place, String type) {
  switch (type.toLowerCase()) {
    case 'postal':
      return place.postalCode;
    case 'locality':
      return place.locality;
    case 'admin':
      return place.administrativeArea;
    case 'country':
      return place.country;
    default:
      return null;
  }
}