state property

StatefulDataState get state

Current state of the data.

Possible options are defined by StatefulDataState.

Implementation

StatefulDataState get state {
  if (_isLoading) {
    if (isEmptyValidator.call(data)) {
      return StatefulDataState.initialLoading;
    } else {
      return StatefulDataState.loading;
    }
  } else {
    if (_error == null) {
      if (isEmptyValidator.call(data)) {
        return StatefulDataState.empty;
      } else {
        return StatefulDataState.ready;
      }
    } else {
      if (data == null) {
        return StatefulDataState.initialLoadingError;
      } else {
        return StatefulDataState.error;
      }
    }
  }
}