withFeedback method
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;
}