services_state.dart 1.3 KB

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