data property

T get data

Attempts to get the Result.data of the current Result value.

If no data is available in the current Result, the onErrorReturn callback, if specified, will be invoked to produce fallback data. Otherwise a NoDataException will be thrown.

Implementation

T get data {
  if (value.hasData) {
    return value.data!;
  } else if (onErrorReturn != null) {
    return onErrorReturn!(NoDataException());
  } else {
    throw NoDataException();
  }
}
set data (T newValue)

Set the value of this notifier as a Data Result, containing the specified data.

Implementation

set data(T newValue) => value = Data(data: newValue);