toJson method
Implementation
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['name'] = name;
data['slug'] = slug;
data['isprava_built'] = ispravaBuilt;
data['built_by'] = builtBy;
if (images != null) {
data['images'] = images!.map((v) => v.toJson()).toList();
}
if (featuredIn != null) {
data['featured_in'] = featuredIn!.map((v) => v).toList();
}
data['address'] = address;
if (location != null) {
data['location'] = location!.toJson();
}
data['bedroom_count'] = bedroomCount;
data['max_guests'] = maxGuests;
data['currency_code'] = currencyCode;
data['currency_symbol'] = currencySymbol;
data['pools_count'] = poolsCount;
data['baths_count'] = bathsCount;
data['pets_allowed'] = petsAllowed;
data['sold_out'] = soldOut;
data['price'] = price;
data['discounted_price'] = discountedPrice;
data['upcoming'] = upcoming;
data['status'] = status;
data['brand'] = brand;
data['brand_id'] = brandId;
data['card_layout'] = cardLayout;
if (propertyConfigs != null) {
data['property_configs'] =
propertyConfigs!.map((v) => v.toJson()).toList();
}
if (nextAvailability != null) {
data['next_availability'] =
nextAvailability!.map((v) => v.toJson()).toList();
}
data['tier_discount_percentage'] = tierDiscountPercentage;
data['discount_method'] = discountMethod;
return data;
}