rewards_home_state.dart 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /// YApi QuickType插件生成,具体参考文档:https://plugins.jetbrains.com/plugin/18847-yapi-quicktype/documentation
  2. import 'dart:convert';
  3. RewardsHomeState rewardsHomeStateFromJson(String str) =>
  4. RewardsHomeState.fromJson(json.decode(str));
  5. String rewardsHomeStateToJson(RewardsHomeState data) =>
  6. json.encode(data.toJson());
  7. class RewardsHomeState {
  8. RewardsHomeState({
  9. required this.curPage,
  10. required this.pageSize,
  11. required this.list,
  12. required this.filterCount,
  13. required this.lists,
  14. });
  15. int curPage;
  16. int pageSize;
  17. List<Map<String, dynamic>> list;
  18. int filterCount;
  19. List<Map<String, dynamic>> lists;
  20. factory RewardsHomeState.fromJson(Map<dynamic, dynamic> json) =>
  21. RewardsHomeState(
  22. curPage: json["curPage"],
  23. pageSize: json["pageSize"],
  24. list: List<Map<String, dynamic>>.from(json["list"].map((x) => x)),
  25. filterCount: json["filterCount"],
  26. lists: List<Map<String, dynamic>>.from(json["lists"].map((x) => x)),
  27. );
  28. Map<dynamic, dynamic> toJson() => {
  29. "curPage": curPage,
  30. "pageSize": pageSize,
  31. "list": List<dynamic>.from(list.map((x) => x)),
  32. "filterCount": filterCount,
  33. "lists": List<dynamic>.from(lists.map((x) => x)),
  34. };
  35. RewardsHomeState copyWith({
  36. int? curPage,
  37. int? pageSize,
  38. List<Map<String, dynamic>>? list,
  39. int? filterCount,
  40. List<Map<String, dynamic>>? lists,
  41. }) {
  42. return RewardsHomeState(
  43. curPage: curPage ?? this.curPage,
  44. pageSize: pageSize ?? this.pageSize,
  45. list: list ?? this.list,
  46. filterCount: filterCount ?? this.filterCount,
  47. lists: list ?? this.lists,
  48. );
  49. }
  50. }