copyWith method
MutationState<TData, TError>
copyWith({
- MutationStatus? status,
- TData? data,
- TError? error,
- bool clearError = false,
Creates a copy of this state with the given fields replaced.
Implementation
MutationState<TData, TError> copyWith({
MutationStatus? status,
TData? data,
TError? error,
bool clearError = false,
}) {
return MutationState<TData, TError>(
status: status ?? this.status,
data: data ?? this.data,
error: clearError ? null : (error ?? this.error),
);
}