copyWith method

SmartPaginationLoaded<T> copyWith({
  1. List<T>? items,
  2. List<T>? allItems,
  3. bool? hasReachedEnd,
  4. PaginationMeta? meta,
  5. DateTime? lastUpdate,
  6. bool? isLoadingMore,
  7. Exception? loadMoreError,
  8. DateTime? fetchedAt,
  9. DateTime? dataExpiredAt,
  10. String? activeOrderId,
})

Implementation

SmartPaginationLoaded<T> copyWith({
  List<T>? items,
  List<T>? allItems,
  bool? hasReachedEnd,
  PaginationMeta? meta,
  DateTime? lastUpdate,
  bool? isLoadingMore,
  Exception? loadMoreError,
  DateTime? fetchedAt,
  DateTime? dataExpiredAt,
  String? activeOrderId,
}) {
  final updatedAllItems = allItems ?? this.allItems;
  final updatedItems = items ?? this.items;

  return SmartPaginationLoaded<T>(
    items: updatedItems,
    allItems: updatedAllItems,
    hasReachedEnd: hasReachedEnd ?? this.hasReachedEnd,
    meta: meta ?? this.meta,
    lastUpdate: lastUpdate ?? this.lastUpdate,
    isLoadingMore: isLoadingMore ?? this.isLoadingMore,
    loadMoreError: loadMoreError ?? this.loadMoreError,
    fetchedAt: fetchedAt ?? this.fetchedAt,
    dataExpiredAt: dataExpiredAt ?? this.dataExpiredAt,
    activeOrderId: activeOrderId ?? this.activeOrderId,
  );
}