copyWith method

TListState<T, K> copyWith({
  1. LinkedHashSet<K>? selectedKeys,
  2. LinkedHashSet<K>? expandedKeys,
  3. List<TListItem<T, K>>? displayItems,
  4. int? page,
  5. int? itemsPerPage,
  6. int? totalItems,
  7. bool? loading,
  8. bool? fetching,
  9. bool? hasMoreItems,
  10. String? search,
  11. TListError? error,
  12. K? expandedDetailKey,
  13. K? editingItemKey,
  14. bool? isCreatingItem,
  15. String? currentCursor,
  16. String? nextCursor,
  17. List<String>? cursorHistory,
  18. Map<String, dynamic>? advancedSearch,
  19. Map<String, dynamic>? additional,
})

Creates a copy of this state with the given fields updated.

Implementation

TListState<T, K> copyWith({
  LinkedHashSet<K>? selectedKeys,
  LinkedHashSet<K>? expandedKeys,
  List<TListItem<T, K>>? displayItems,
  int? page,
  int? itemsPerPage,
  int? totalItems,
  bool? loading,
  bool? fetching,
  bool? hasMoreItems,
  String? search,
  TListError? error,
  K? expandedDetailKey,
  K? editingItemKey,
  bool? isCreatingItem,
  String? currentCursor,
  String? nextCursor,
  List<String>? cursorHistory,
  Map<String, dynamic>? advancedSearch,
  Map<String, dynamic>? additional,
}) {
  return TListState<T, K>(
    selectedKeys: selectedKeys ?? this.selectedKeys,
    expandedKeys: expandedKeys ?? this.expandedKeys,
    displayItems: displayItems ?? this.displayItems,
    page: page ?? this.page,
    itemsPerPage: itemsPerPage ?? this.itemsPerPage,
    totalItems: totalItems ?? this.totalItems,
    loading: loading ?? this.loading,
    fetching: fetching ?? this.fetching,
    hasMoreItems: hasMoreItems ?? this.hasMoreItems,
    search: search ?? this.search,
    error: error ?? this.error,
    expandedDetailKey: expandedDetailKey ?? this.expandedDetailKey,
    editingItemKey: editingItemKey ?? this.editingItemKey,
    isCreatingItem: isCreatingItem ?? this.isCreatingItem,
    currentCursor: currentCursor ?? this.currentCursor,
    nextCursor: nextCursor ?? this.nextCursor,
    cursorHistory: cursorHistory ?? this.cursorHistory,
    advancedSearch: advancedSearch ?? this.advancedSearch,
    additional: additional ?? this.additional,
  );
}