copyWith method

CkResponse<T> copyWith({
  1. T? data,
  2. bool? isSuccess,
  3. bool? isRequesting,
  4. String? error,
  5. dynamic meta,
  6. dynamic raw,
  7. CancelToken? cancelToken,
  8. int? responseCode,
})

Implementation

CkResponse<T> copyWith({
  T? data,
  bool? isSuccess,
  bool? isRequesting,
  String? error,
  meta,
  raw,
  CancelToken? cancelToken,
  int? responseCode,
}) {
  return CkResponse<T>(
    data: data ?? this.data,
    raw: raw ?? this.raw,
    isRequesting: isRequesting ?? this.isRequesting,
    message: error ?? message,
    meta: meta ?? this.meta,
    cancelToken: cancelToken ?? this.cancelToken,
    isSuccess: isSuccess ?? this.isSuccess,
    statusCode: responseCode ?? statusCode,
  );
}