copyWith method

PaginationState<T> copyWith({
  1. List<T>? items,
  2. int? currentPage,
  3. int? lastPage,
  4. bool? isLoading,
  5. bool? loadingInitialPage,
  6. bool? hasError,
  7. int? total,
  8. String? searchQuery,
})

Copies the current state with the given values.

Implementation

PaginationState<T> copyWith({
  List<T>? items,
  int? currentPage,
  int? lastPage,
  bool? isLoading,
  bool? loadingInitialPage,
  bool? hasError,
  int? total,
  String? searchQuery,
}) {
  return PaginationState<T>(
    items: items ?? this.items,
    currentPage: currentPage ?? this.currentPage,
    lastPage: lastPage ?? this.lastPage,
    isLoading: isLoading ?? this.isLoading,
    loadingInitialPage: loadingInitialPage ?? this.loadingInitialPage,
    hasError: hasError ?? this.hasError,
    total: total ?? this.total,
    searchQuery: searchQuery ?? this.searchQuery,
  );
}