common.dart 469 B

1234567891011121314151617181920212223242526
  1. /// 分页数据集合
  2. class PagedDataCollection<T> {
  3. /// 总数
  4. final int totalCount;
  5. /// 当前页
  6. ///
  7. /// - 从 `1` 开始
  8. final int pageIndex;
  9. /// 页码
  10. final int pageSize;
  11. /// 数据集合
  12. final List<T> data;
  13. /// 是否有下一页
  14. bool get hasNextPage => totalCount > pageIndex * pageSize;
  15. PagedDataCollection({
  16. required this.totalCount,
  17. required this.pageIndex,
  18. required this.pageSize,
  19. required this.data,
  20. });
  21. }