property_sale_rent_entity.g.dart 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. import 'package:domain/generated/json/base/json_convert_content.dart';
  2. import 'package:domain/entity/property_sale_rent_entity.dart';
  3. PropertySaleRentEntity $PropertySaleRentEntityFromJson(
  4. Map<String, dynamic> json) {
  5. final PropertySaleRentEntity propertySaleRentEntity = PropertySaleRentEntity();
  6. final int? count = jsonConvert.convert<int>(json['count']);
  7. if (count != null) {
  8. propertySaleRentEntity.count = count;
  9. }
  10. final int? page = jsonConvert.convert<int>(json['page']);
  11. if (page != null) {
  12. propertySaleRentEntity.page = page;
  13. }
  14. final int? limit = jsonConvert.convert<int>(json['limit']);
  15. if (limit != null) {
  16. propertySaleRentEntity.limit = limit;
  17. }
  18. final int? countPage = jsonConvert.convert<int>(json['count_page']);
  19. if (countPage != null) {
  20. propertySaleRentEntity.countPage = countPage;
  21. }
  22. final List<PropertySaleRentList>? list = (json['list'] as List<dynamic>?)
  23. ?.map(
  24. (e) =>
  25. jsonConvert.convert<PropertySaleRentList>(e) as PropertySaleRentList)
  26. .toList();
  27. if (list != null) {
  28. propertySaleRentEntity.list = list;
  29. }
  30. return propertySaleRentEntity;
  31. }
  32. Map<String, dynamic> $PropertySaleRentEntityToJson(
  33. PropertySaleRentEntity entity) {
  34. final Map<String, dynamic> data = <String, dynamic>{};
  35. data['count'] = entity.count;
  36. data['page'] = entity.page;
  37. data['limit'] = entity.limit;
  38. data['count_page'] = entity.countPage;
  39. data['list'] = entity.list?.map((v) => v.toJson()).toList();
  40. return data;
  41. }
  42. extension PropertySaleRentEntityExtension on PropertySaleRentEntity {
  43. PropertySaleRentEntity copyWith({
  44. int? count,
  45. int? page,
  46. int? limit,
  47. int? countPage,
  48. List<PropertySaleRentList>? list,
  49. }) {
  50. return PropertySaleRentEntity()
  51. ..count = count ?? this.count
  52. ..page = page ?? this.page
  53. ..limit = limit ?? this.limit
  54. ..countPage = countPage ?? this.countPage
  55. ..list = list ?? this.list;
  56. }
  57. }
  58. PropertySaleRentList $PropertySaleRentListFromJson(Map<String, dynamic> json) {
  59. final PropertySaleRentList propertySaleRentList = PropertySaleRentList();
  60. final int? id = jsonConvert.convert<int>(json['id']);
  61. if (id != null) {
  62. propertySaleRentList.id = id;
  63. }
  64. final int? type = jsonConvert.convert<int>(json['type']);
  65. if (type != null) {
  66. propertySaleRentList.type = type;
  67. }
  68. final String? title = jsonConvert.convert<String>(json['title']);
  69. if (title != null) {
  70. propertySaleRentList.title = title;
  71. }
  72. final String? price = jsonConvert.convert<String>(json['price']);
  73. if (price != null) {
  74. propertySaleRentList.price = price;
  75. }
  76. final String? priceShow = jsonConvert.convert<String>(json['price_show']);
  77. if (priceShow != null) {
  78. propertySaleRentList.priceShow = priceShow;
  79. }
  80. final String? units = jsonConvert.convert<String>(json['units']);
  81. if (units != null) {
  82. propertySaleRentList.units = units;
  83. }
  84. final String? createdAt = jsonConvert.convert<String>(json['created_at']);
  85. if (createdAt != null) {
  86. propertySaleRentList.createdAt = createdAt;
  87. }
  88. return propertySaleRentList;
  89. }
  90. Map<String, dynamic> $PropertySaleRentListToJson(PropertySaleRentList entity) {
  91. final Map<String, dynamic> data = <String, dynamic>{};
  92. data['id'] = entity.id;
  93. data['type'] = entity.type;
  94. data['title'] = entity.title;
  95. data['price'] = entity.price;
  96. data['price_show'] = entity.priceShow;
  97. data['units'] = entity.units;
  98. data['created_at'] = entity.createdAt;
  99. return data;
  100. }
  101. extension PropertySaleRentListExtension on PropertySaleRentList {
  102. PropertySaleRentList copyWith({
  103. int? id,
  104. int? type,
  105. String? title,
  106. String? price,
  107. String? priceShow,
  108. String? units,
  109. String? createdAt,
  110. }) {
  111. return PropertySaleRentList()
  112. ..id = id ?? this.id
  113. ..type = type ?? this.type
  114. ..title = title ?? this.title
  115. ..price = price ?? this.price
  116. ..priceShow = priceShow ?? this.priceShow
  117. ..units = units ?? this.units
  118. ..createdAt = createdAt ?? this.createdAt;
  119. }
  120. }