SeachPlaceResultDetailModel.fromJson constructor

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

Implementation

SeachPlaceResultDetailModel.fromJson(Map<String, dynamic> json) {
  if (json["address_components"] is List)
    this.addressComponents = json["address_components"] == null
        ? null
        : (json["address_components"] as List).map((e) => AddressComponents.fromJson(e)).toList();
  if (json["adr_address"] is String) this.adrAddress = json["adr_address"];
  if (json["business_status"] is String) this.businessStatus = json["business_status"];
  if (json["formatted_address"] is String) this.formattedAddress = json["formatted_address"];
  if (json["formatted_phone_number"] is String)
    this.formattedPhoneNumber = json["formatted_phone_number"];
  if (json["geometry"] is Map)
    this.geometry = json["geometry"] == null ? null : DetailGeometry.fromJson(json["geometry"]);
  if (json["icon"] is String) this.icon = json["icon"];
  if (json["icon_background_color"] is String)
    this.iconBackgroundColor = json["icon_background_color"];
  if (json["icon_mask_base_uri"] is String) this.iconMaskBaseUri = json["icon_mask_base_uri"];
  if (json["international_phone_number"] is String)
    this.internationalPhoneNumber = json["international_phone_number"];
  if (json["name"] is String) this.name = json["name"];
  if (json["opening_hours"] is Map)
    this.openingHours =
        json["opening_hours"] == null ? null : DetailOpeningHours.fromJson(json["opening_hours"]);
  if (json["photos"] is List)
    this.photos = json["photos"] == null
        ? null
        : (json["photos"] as List).map((e) => DetailPhotos.fromJson(e)).toList();
  if (json["place_id"] is String) this.placeId = json["place_id"];
  if (json["plus_code"] is Map)
    this.plusCode = json["plus_code"] == null ? null : PlusCodeModel.fromJson(json["plus_code"]);
  if (json["price_level"] is int) this.priceLevel = json["price_level"];
  if (json["rating"] is double) this.rating = json["rating"];
  if (json["reference"] is String) this.reference = json["reference"];
  if (json["reviews"] is List)
    this.reviews = json["reviews"] == null
        ? null
        : (json["reviews"] as List).map((e) => Reviews.fromJson(e)).toList();
  if (json["types"] is List)
    this.types = json["types"] == null ? null : List<String>.from(json["types"]);
  if (json["url"] is String) this.url = json["url"];
  if (json["user_ratings_total"] is int) this.userRatingsTotal = json["user_ratings_total"];
  if (json["utc_offset"] is int) this.utcOffset = json["utc_offset"];
  if (json["vicinity"] is String) this.vicinity = json["vicinity"];
  if (json["website"] is String) this.website = json["website"];
}