Properties.fromJson constructor

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

Implementation

Properties.fromJson(Map<String, dynamic> json) {
  name = json['name'];
  slug = json['slug'];
  ispravaBuilt = json['isprava_built'];
  builtBy = json['built_by'];
  if (json['images'] != null) {
    images = <Images>[];
    json['images'].forEach((v) {
      images!.add(Images.fromJson(v));
    });
  }
  if (json['featured_in'] != null) {
    featuredIn = <String>[];
    json['featured_in'].forEach((v) {
      featuredIn!.add(v);
    });
  }
  address = json['address'];
  location =
      json['location'] != null ? Location.fromJson(json['location']) : null;
  bedroomCount = json['bedroom_count'];
  maxGuests = json['max_guests'];
  currencyCode = json['currency_code'];
  currencySymbol = json['currency_symbol'];
  poolsCount = json['pools_count'] as int;
  bathsCount = json['baths_count'] as int;
  petsAllowed = json['pets_allowed'];
  soldOut = json['sold_out'];
  price = json['price'] as int;
  discountedPrice = json['discounted_price'];
  upcoming = json['upcoming'];
  status = json['status'];
  brand = json['brand'];
  brandId = json['brand_id'];
  cardLayout = json['card_layout'];
  if (json['property_configs'] != null) {
    propertyConfigs = <PropertyConfigs>[];
    json['property_configs'].forEach((v) {
      propertyConfigs!.add(PropertyConfigs.fromJson(v));
    });
  }
  if (json['next_availability'] != null) {
    nextAvailability = <NextAvailability>[];
    json['next_availability'].forEach((v) {
      nextAvailability!.add(NextAvailability.fromJson(v));
    });
  }
  tierDiscountPercentage = json['tier_discount_percentage'];
  discountMethod = json['discount_method'];
}