copy method
- 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,
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,
);
}