fromMap static method

Placemark fromMap(
  1. dynamic message
)

Converts the supplied Map to an instance of the Placemark class.

Implementation

static Placemark fromMap(dynamic message) {
  if (message == null) {
    throw ArgumentError('The parameter \'message\' should not be null.');
  }

  final Map<dynamic, dynamic> placemarkMap = message;

  return Placemark._(
    name: placemarkMap['name'] ?? '',
    street: placemarkMap['street'] ?? '',
    isoCountryCode: placemarkMap['isoCountryCode'] ?? '',
    country: placemarkMap['country'] ?? '',
    postalCode: placemarkMap['postalCode'] ?? '',
    administrativeArea: placemarkMap['administrativeArea'] ?? '',
    subAdministrativeArea: placemarkMap['subAdministrativeArea'] ?? '',
    locality: placemarkMap['locality'] ?? '',
    subLocality: placemarkMap['subLocality'] ?? '',
    thoroughfare: placemarkMap['thoroughfare'] ?? '',
    subThoroughfare: placemarkMap['subThoroughfare'] ?? '',
  );
}