modify method
Response<T>
modify(
{ - T? data,
- List<T>? backups,
- List<T>? ignores,
- List<T>? result,
- double? progress,
- Status? status,
- String? exception,
- String? message,
- dynamic feedback,
- dynamic snapshot,
})
Implementation
Response<T> modify({
T? data,
List<T>? backups,
List<T>? ignores,
List<T>? result,
double? progress,
Status? status,
String? exception,
String? message,
dynamic feedback,
dynamic snapshot,
}) {
status ??= (data != null || result != null)
? Status.ok
: (exception ?? '').isNotEmpty
? Status.error
: null;
_data = data ?? _data;
_backups = backups ?? _backups;
_ignores = ignores ?? _ignores;
_result = result ?? _result;
_progress = progress ?? _progress;
_status = status ?? _status;
_error = exception ?? _error;
_message = message ?? _message;
this.feedback = feedback ?? this.feedback;
this.snapshot = snapshot ?? this.snapshot;
return this;
}