withData method

Response<T> withData(
  1. T? data, {
  2. String? message,
  3. Status? status,
})

Sets the data associated with the response and marks the response as successful.

data: The data to be associated with the response. message: Additional message. status: Status of the response. Returns the modified Response object with updated data and success status.

Implementation

Response<T> withData(T? data, {String? message, Status? status}) {
  _status = status ?? Status.ok;
  _data = data;
  _message = message;
  _successful = true;
  _complete = true;
  _loading = false;
  return this;
}