copyWith method

PaginationState<T> copyWith({
  1. List<T>? items,
  2. int? currentPage,
  3. int? pageSize,
  4. int? totalItems,
  5. bool? hasMore,
  6. bool? isLoading,
  7. Object? error,
})

Implementation

PaginationState<T> copyWith({
  List<T>? items,
  int? currentPage,
  int? pageSize,
  int? totalItems,
  bool? hasMore,
  bool? isLoading,
  Object? error,
}) {
  return PaginationState<T>(
    items: items ?? this.items,
    currentPage: currentPage ?? this.currentPage,
    pageSize: pageSize ?? this.pageSize,
    totalItems: totalItems ?? this.totalItems,
    hasMore: hasMore ?? this.hasMore,
    isLoading: isLoading ?? this.isLoading,
    error: error ?? this.error,
  );
}