rewards_index_entity.dart 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import 'package:domain/generated/json/base/json_field.dart';
  2. import 'package:domain/generated/json/rewards_index_entity.g.dart';
  3. import 'dart:convert';
  4. export 'package:domain/generated/json/rewards_index_entity.g.dart';
  5. @JsonSerializable()
  6. class RewardsIndexEntity {
  7. late int points = 0;
  8. late RewardsIndexContinuous continuous;
  9. late RewardsIndexTasks tasks;
  10. late List<dynamic> latest = [];
  11. RewardsIndexEntity();
  12. factory RewardsIndexEntity.fromJson(Map<String, dynamic> json) => $RewardsIndexEntityFromJson(json);
  13. Map<String, dynamic> toJson() => $RewardsIndexEntityToJson(this);
  14. @override
  15. String toString() {
  16. return jsonEncode(this);
  17. }
  18. }
  19. @JsonSerializable()
  20. class RewardsIndexContinuous {
  21. late int count = 0;
  22. @JSONField(name: "current_week_checkin")
  23. late List<dynamic> currentWeekCheckin = [];
  24. RewardsIndexContinuous();
  25. factory RewardsIndexContinuous.fromJson(Map<String, dynamic> json) => $RewardsIndexContinuousFromJson(json);
  26. Map<String, dynamic> toJson() => $RewardsIndexContinuousToJson(this);
  27. @override
  28. String toString() {
  29. return jsonEncode(this);
  30. }
  31. }
  32. @JsonSerializable()
  33. class RewardsIndexTasks {
  34. @JSONField(name: "daily_checkin")
  35. late bool dailyCheckin = false;
  36. @JSONField(name: "news_feed_post")
  37. late bool newsFeedPost = false;
  38. @JSONField(name: "give_10_likes")
  39. late int give10Likes = 0;
  40. RewardsIndexTasks();
  41. factory RewardsIndexTasks.fromJson(Map<String, dynamic> json) => $RewardsIndexTasksFromJson(json);
  42. Map<String, dynamic> toJson() => $RewardsIndexTasksToJson(this);
  43. @override
  44. String toString() {
  45. return jsonEncode(this);
  46. }
  47. }