home_list_entity.dart 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. import 'package:domain/generated/json/base/json_field.dart';
  2. import 'package:domain/generated/json/home_list_entity.g.dart';
  3. import 'dart:convert';
  4. export 'package:domain/generated/json/home_list_entity.g.dart';
  5. @JsonSerializable()
  6. class HomeListEntity {
  7. List<HomeListBanners> banners = [];
  8. @JSONField(name: "latest_transactions")
  9. List<HomeListLatestTransactions> latestTransactions = [];
  10. @JSONField(name: "property_news")
  11. List<HomeListPropertyNews> propertyNews = [];
  12. @JSONField(name: "strata_management_guides")
  13. List<HomeListPropertyNews> strataManagementGuides = [];
  14. HomeListEntity();
  15. factory HomeListEntity.fromJson(Map<String, dynamic> json) => $HomeListEntityFromJson(json);
  16. Map<String, dynamic> toJson() => $HomeListEntityToJson(this);
  17. @override
  18. String toString() {
  19. return jsonEncode(this);
  20. }
  21. }
  22. @JsonSerializable()
  23. class HomeListBanners {
  24. String? id;
  25. String? name;
  26. String? image;
  27. HomeListBanners();
  28. factory HomeListBanners.fromJson(Map<String, dynamic> json) => $HomeListBannersFromJson(json);
  29. Map<String, dynamic> toJson() => $HomeListBannersToJson(this);
  30. @override
  31. String toString() {
  32. return jsonEncode(this);
  33. }
  34. }
  35. @JsonSerializable()
  36. class HomeListLatestTransactions {
  37. String? id;
  38. int type = 0;
  39. String? title;
  40. String? price;
  41. @JSONField(name: "created_at")
  42. String? createdAt;
  43. HomeListLatestTransactions();
  44. factory HomeListLatestTransactions.fromJson(Map<String, dynamic> json) => $HomeListLatestTransactionsFromJson(json);
  45. Map<String, dynamic> toJson() => $HomeListLatestTransactionsToJson(this);
  46. @override
  47. String toString() {
  48. return jsonEncode(this);
  49. }
  50. }
  51. @JsonSerializable()
  52. class HomeListPropertyNews {
  53. String? id;
  54. String? title;
  55. @JSONField(name: "cover_image")
  56. String? coverImage;
  57. @JSONField(name: "created_at")
  58. String? createdAt;
  59. HomeListPropertyNews();
  60. factory HomeListPropertyNews.fromJson(Map<String, dynamic> json) => $HomeListPropertyNewsFromJson(json);
  61. Map<String, dynamic> toJson() => $HomeListPropertyNewsToJson(this);
  62. @override
  63. String toString() {
  64. return jsonEncode(this);
  65. }
  66. }