toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic> data = new Map<String, dynamic>();
  if (this.addressComponents != null)
    data["address_components"] = this.addressComponents?.map((e) => e.toJson()).toList();
  data["adr_address"] = this.adrAddress;
  data["business_status"] = this.businessStatus;
  data["formatted_address"] = this.formattedAddress;
  data["formatted_phone_number"] = this.formattedPhoneNumber;
  if (this.geometry != null) data["geometry"] = this.geometry?.toJson();
  data["icon"] = this.icon;
  data["icon_background_color"] = this.iconBackgroundColor;
  data["icon_mask_base_uri"] = this.iconMaskBaseUri;
  data["international_phone_number"] = this.internationalPhoneNumber;
  data["name"] = this.name;
  if (this.openingHours != null) data["opening_hours"] = this.openingHours?.toJson();
  if (this.photos != null) data["photos"] = this.photos?.map((e) => e.toJson()).toList();
  data["place_id"] = this.placeId;
  if (this.plusCode != null) data["plus_code"] = this.plusCode?.toJson();
  data["price_level"] = this.priceLevel;
  data["rating"] = this.rating;
  data["reference"] = this.reference;
  if (this.reviews != null) data["reviews"] = this.reviews?.map((e) => e.toJson()).toList();
  if (this.types != null) data["types"] = this.types;
  data["url"] = this.url;
  data["user_ratings_total"] = this.userRatingsTotal;
  data["utc_offset"] = this.utcOffset;
  data["vicinity"] = this.vicinity;
  data["website"] = this.website;
  return data;
}