import 'package:domain/generated/json/base/json_convert_content.dart'; import 'package:domain/entity/property_sale_rent_entity.dart'; PropertySaleRentEntity $PropertySaleRentEntityFromJson( Map json) { final PropertySaleRentEntity propertySaleRentEntity = PropertySaleRentEntity(); final int? count = jsonConvert.convert(json['count']); if (count != null) { propertySaleRentEntity.count = count; } final int? page = jsonConvert.convert(json['page']); if (page != null) { propertySaleRentEntity.page = page; } final int? limit = jsonConvert.convert(json['limit']); if (limit != null) { propertySaleRentEntity.limit = limit; } final int? countPage = jsonConvert.convert(json['count_page']); if (countPage != null) { propertySaleRentEntity.countPage = countPage; } final List? list = (json['list'] as List?) ?.map( (e) => jsonConvert.convert(e) as PropertySaleRentList) .toList(); if (list != null) { propertySaleRentEntity.list = list; } return propertySaleRentEntity; } Map $PropertySaleRentEntityToJson( PropertySaleRentEntity entity) { final Map data = {}; data['count'] = entity.count; data['page'] = entity.page; data['limit'] = entity.limit; data['count_page'] = entity.countPage; data['list'] = entity.list?.map((v) => v.toJson()).toList(); return data; } extension PropertySaleRentEntityExtension on PropertySaleRentEntity { PropertySaleRentEntity copyWith({ int? count, int? page, int? limit, int? countPage, List? list, }) { return PropertySaleRentEntity() ..count = count ?? this.count ..page = page ?? this.page ..limit = limit ?? this.limit ..countPage = countPage ?? this.countPage ..list = list ?? this.list; } } PropertySaleRentList $PropertySaleRentListFromJson(Map json) { final PropertySaleRentList propertySaleRentList = PropertySaleRentList(); final int? id = jsonConvert.convert(json['id']); if (id != null) { propertySaleRentList.id = id; } final int? type = jsonConvert.convert(json['type']); if (type != null) { propertySaleRentList.type = type; } final String? title = jsonConvert.convert(json['title']); if (title != null) { propertySaleRentList.title = title; } final String? price = jsonConvert.convert(json['price']); if (price != null) { propertySaleRentList.price = price; } final String? priceShow = jsonConvert.convert(json['price_show']); if (priceShow != null) { propertySaleRentList.priceShow = priceShow; } final String? units = jsonConvert.convert(json['units']); if (units != null) { propertySaleRentList.units = units; } final String? createdAt = jsonConvert.convert(json['created_at']); if (createdAt != null) { propertySaleRentList.createdAt = createdAt; } return propertySaleRentList; } Map $PropertySaleRentListToJson(PropertySaleRentList entity) { final Map data = {}; data['id'] = entity.id; data['type'] = entity.type; data['title'] = entity.title; data['price'] = entity.price; data['price_show'] = entity.priceShow; data['units'] = entity.units; data['created_at'] = entity.createdAt; return data; } extension PropertySaleRentListExtension on PropertySaleRentList { PropertySaleRentList copyWith({ int? id, int? type, String? title, String? price, String? priceShow, String? units, String? createdAt, }) { return PropertySaleRentList() ..id = id ?? this.id ..type = type ?? this.type ..title = title ?? this.title ..price = price ?? this.price ..priceShow = priceShow ?? this.priceShow ..units = units ?? this.units ..createdAt = createdAt ?? this.createdAt; } }