handleEmpty method

void handleEmpty({
  1. OnSuccessEmpty? onSuccess,
  2. OnError? onError,
  3. OnException? onException,
  4. OnFailure? onFailure,
})

Implementation

void handleEmpty({
  OnSuccessEmpty? onSuccess,
  OnError? onError,
  OnException? onException,
  OnFailure? onFailure,
}) {
  if (success) {
    onSuccess?.call(response);
  } else if (error && (onError != null)) {
    onError(response);
  } else if (hasException && (onException != null)) {
    onException(_exception);
  } else {
    onFailure?.call(response, _exception);
  }
}