copyWith method

PagedState<PageKeyType, ItemType> copyWith({
  1. List<ItemType>? records,
  2. dynamic error,
  3. dynamic nextPageKey = undefined,
})

Implementation

PagedState<PageKeyType, ItemType> copyWith(
    {List<ItemType>? records,
    dynamic error,
    dynamic nextPageKey = undefined}) {
  return PagedState<PageKeyType, ItemType>(
      records: records ?? this.records,
      error: error ?? this.error,
      nextPageKey: nextPageKey == undefined
          ? this.nextPageKey
          : nextPageKey as PageKeyType?);
}