SeachPlaceResultModel.fromJson constructor
SeachPlaceResultModel.fromJson(
- Map<String, dynamic> json
)
Implementation
SeachPlaceResultModel.fromJson(Map<String, dynamic> json) {
if (json["business_status"] is String) this.businessStatus = json["business_status"];
if (json["formatted_address"] is String) this.formattedAddress = json["formatted_address"];
if (json["geometry"] is Map)
this.geometry = json["geometry"] == null ? null : Geometry.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["name"] is String) this.name = json["name"];
if (json["opening_hours"] is Map)
this.openingHours =
json["opening_hours"] == null ? null : OpeningHours.fromJson(json["opening_hours"]);
if (json["photos"] is List)
this.photos = json["photos"] == null
? null
: (json["photos"] as List).map((e) => Photos.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 : PlusCode.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["types"] is List)
this.types = json["types"] == null ? null : List<String>.from(json["types"]);
if (json["user_ratings_total"] is int) this.userRatingsTotal = json["user_ratings_total"];
}