page.dart 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. class Page {
  2. String? totalCount;
  3. int? pageSize;
  4. int? totalPage;
  5. int? firstPage;
  6. int? prevPage;
  7. int? nextPage;
  8. int? lastPage;
  9. int? currentPage;
  10. List<int>? allPages;
  11. int? offset;
  12. int? limit;
  13. Page(
  14. {this.totalCount,
  15. this.pageSize,
  16. this.totalPage,
  17. this.firstPage,
  18. this.prevPage,
  19. this.nextPage,
  20. this.lastPage,
  21. this.currentPage,
  22. this.allPages,
  23. this.offset,
  24. this.limit});
  25. Page.fromJson(Map<String, dynamic> json) {
  26. totalCount = json['total_count'];
  27. pageSize = json['page_size'];
  28. totalPage = json['total_page'];
  29. firstPage = json['first_page'];
  30. prevPage = json['prev_page'];
  31. nextPage = json['next_page'];
  32. lastPage = json['last_page'];
  33. currentPage = json['current_page'];
  34. allPages = json['all_pages'].cast<int>();
  35. offset = json['offset'];
  36. limit = json['limit'];
  37. }
  38. Map<String, dynamic> toJson() {
  39. final Map<String, dynamic> data = new Map<String, dynamic>();
  40. data['total_count'] = this.totalCount;
  41. data['page_size'] = this.pageSize;
  42. data['total_page'] = this.totalPage;
  43. data['first_page'] = this.firstPage;
  44. data['prev_page'] = this.prevPage;
  45. data['next_page'] = this.nextPage;
  46. data['last_page'] = this.lastPage;
  47. data['current_page'] = this.currentPage;
  48. data['all_pages'] = this.allPages;
  49. data['offset'] = this.offset;
  50. data['limit'] = this.limit;
  51. return data;
  52. }
  53. }