copyWith method
ListState
copyWith({ - List<String>? ids,
- int? total,
- String? nextCursor,
- String? prevCursor,
- bool? hasNextPage,
- bool? hasPrevPage,
- bool? isFetching,
- bool? isFetchingMore,
- String? error,
- DateTime? lastFetched,
- bool? stale,
- bool clearError = false,
- bool clearTotal = false,
- bool clearNextCursor = false,
- bool clearPrevCursor = false,
})
Implementation
ListState copyWith({
List<String>? ids,
int? total,
String? nextCursor,
String? prevCursor,
bool? hasNextPage,
bool? hasPrevPage,
bool? isFetching,
bool? isFetchingMore,
String? error,
DateTime? lastFetched,
bool? stale,
bool clearError = false,
bool clearTotal = false,
bool clearNextCursor = false,
bool clearPrevCursor = false,
}) => ListState(
ids: ids ?? this.ids,
total: clearTotal ? null : (total ?? this.total),
nextCursor: clearNextCursor ? null : (nextCursor ?? this.nextCursor),
prevCursor: clearPrevCursor ? null : (prevCursor ?? this.prevCursor),
hasNextPage: hasNextPage ?? this.hasNextPage,
hasPrevPage: hasPrevPage ?? this.hasPrevPage,
isFetching: isFetching ?? this.isFetching,
isFetchingMore: isFetchingMore ?? this.isFetchingMore,
error: clearError ? null : (error ?? this.error),
lastFetched: lastFetched ?? this.lastFetched,
stale: stale ?? this.stale,
);