copy method

Response<T> copy({
  1. int? requestCode,
  2. bool? available,
  3. bool? cancel,
  4. bool? complete,
  5. bool? error,
  6. bool? failed,
  7. bool? internetError,
  8. bool? loading,
  9. bool? nullable,
  10. bool? paused,
  11. bool? stopped,
  12. bool? successful,
  13. bool? timeout,
  14. bool? valid,
  15. T? data,
  16. List<T>? backups,
  17. List<T>? ignores,
  18. List<T>? result,
  19. double? progress,
  20. Status? status,
  21. String? exception,
  22. String? message,
  23. dynamic feedback,
  24. dynamic snapshot,
})

Creates a copy of the current Response object with optional modifications.

requestCode: The request code associated with the response. available: Indicates if the response is available. cancel: Indicates if the response has been cancelled. complete: Indicates if the response is complete. error: Indicates if an error occurred. failed: Indicates if the operation failed. internetError: Indicates if there's an internet error. loading: Indicates if the response is currently loading. nullable: Indicates if the response can be null. paused: Indicates if the response is paused. stopped: Indicates if the response is stopped. successful: Indicates if the operation was successful. timeout: Indicates if there was a timeout. valid: Indicates if the response is valid. data: The data associated with the response. backups: List of backup data. ignores: List of ignored data. result: List of results. progress: Progress value. status: Status of the response. exception: Exception message. message: Additional message. feedback: Feedback data. snapshot: Snapshot data.

Implementation

Response<T> copy({
  int? requestCode,
  bool? available,
  bool? cancel,
  bool? complete,
  bool? error,
  bool? failed,
  bool? internetError,
  bool? loading,
  bool? nullable,
  bool? paused,
  bool? stopped,
  bool? successful,
  bool? timeout,
  bool? valid,
  T? data,
  List<T>? backups,
  List<T>? ignores,
  List<T>? result,
  double? progress,
  Status? status,
  String? exception,
  String? message,
  dynamic feedback,
  dynamic snapshot,
}) {
  return Response<T>(
    available: available,
    cancel: cancel,
    complete: complete,
    data: data,
    error: error,
    exception: exception,
    failed: failed,
    feedback: feedback,
    internetError: internetError,
    loading: loading ?? false,
    message: message,
    nullable: nullable,
    paused: paused,
    progress: progress ?? _progress,
    requestCode: requestCode ?? this.requestCode,
    backups: backups,
    ignores: ignores,
    result: result,
    snapshot: snapshot,
    status: status,
    stopped: stopped,
    successful: successful,
    timeout: timeout,
    valid: valid,
  );
}