withSnapshot method

Response<T> withSnapshot(
  1. dynamic snapshot, {
  2. String? message,
  3. Status? status,
})

Sets the snapshot data and associated properties with the response.

snapshot: Snapshot data. message: Additional message. status: Status of the response. Returns the modified Response object with updated snapshot data.

Implementation

Response<T> withSnapshot(dynamic snapshot,
    {String? message, Status? status}) {
  this.snapshot = snapshot;
  _status = status;
  _successful = status.isSuccessful;
  _message = message;
  _complete = true;
  _loading = false;
  return this;
}