Result.fromJson constructor

Result.fromJson(
  1. Map<String, dynamic> json
)

Implementation

Result.fromJson(Map<String, dynamic> json) {
  if (json['address_components'] != null) {
    addressComponents = [];
    json['address_components'].forEach((v) {
      addressComponents!.add(new AddressComponents.fromJson(v));
    });
  }
  adrAddress = json['adr_address'];
  formattedAddress = json['formatted_address'];
  geometry = json['geometry'] != null
      ? new Geometry.fromJson(json['geometry'])
      : null;
  icon = json['icon'];
  name = json['name'];
  if (json['photos'] != null) {
    photos = [];
    json['photos'].forEach((v) {
      photos!.add(new Photos.fromJson(v));
    });
  }
  placeId = json['place_id'];
  reference = json['reference'];
  scope = json['scope'];
  types = json['types'].cast<String>();
  url = json['url'];
  utcOffset = json['utc_offset'];
  vicinity = json['vicinity'];
  website = json['website'];
}