handleHttpData method

void handleHttpData({
  1. required ViewStateHttpData<T, E> httpData,
  2. required LoadType loadType,
})

Implementation

void handleHttpData(
    {required ViewStateHttpData<T, E> httpData, required LoadType loadType}) {
  if (httpData.success) {
    data = httpData.data as T;
    setSuccess();
  } else {
    setError(httpData.error);
  }

  if (isSuccess) {
    handleResult.call(httpData, loadType);
  } else {
    handleError(httpData, loadType);
  }
}