BrPlaceModel.fromJson constructor
BrPlaceModel.fromJson(
- Map<String, dynamic> json
)
Implementation
BrPlaceModel.fromJson(Map<String, dynamic> json) {
favorite = json["favorite"] == 1;
if (json["id"] is String) id = json["id"];
if (json["name"] is String) name = json["name"];
if (json["description"] is String) description = json["description"];
if (json["subtitle"] is String) subtitle = json["subtitle"];
if (json["pictureUrl"] is String) pictureUrl = json["pictureUrl"];
if (json["globalNote"] is int) globalNote = json["globalNote"];
if (json["lat"] is double) lat = json["lat"];
if (json["lng"] is double) lng = json["lng"];
if (json["street1"] is String) street1 = json["street1"];
if (json["street2"] is String) street2 = json["street2"];
if (json["zip"] is String) zip = json["zip"];
if (json["city"] is String) city = json["city"];
if (json["state"] is String) state = json["state"];
if (json["country"] is String) country = json["country"];
if (json["catName"] is String) catName = json["catName"];
if (json["colorCode"] is String) colorCode = json["colorCode"];
if (json["colorCode2"] is String) colorCode2 = json["colorCode2"];
if (json["catThumbnail"] is String) catThumbnail = json["catThumbnail"];
if (json["filters"] is List) {
filters = json["filters"] == null
? []
: (json["filters"] as List).map((e) => BrPlaceFilterModel.fromJson(e)).toList();
} else {
filters = [];
}
}