withFeedback method

Response<T> withFeedback(
  1. dynamic feedback, {
  2. String? message,
  3. String? exception,
  4. Status status = Status.ok,
  5. bool loaded = true,
})

Sets feedback data and associated properties with the response.

feedback: Feedback data. message: Additional message. exception: Exception message. status: Status of the response. loaded: Indicates if the response is loaded. Returns the modified Response object with updated feedback and status.

Implementation

Response<T> withFeedback(
  dynamic feedback, {
  String? message,
  String? exception,
  Status status = Status.ok,
  bool loaded = true,
}) {
  this.feedback = feedback;
  _status = status;
  _successful = status.isSuccessful;
  _message = message;
  _exception = exception;
  _complete = loaded;
  _loading = false;
  return this;
}