data property

T? get data

Returns the value if the state is AsyncData, otherwise null.

Implementation

T? get data {
  final self = this;
  if (self is AsyncData<T>) return self.value;
  if (self is AsyncLoading<T>) return self.previous?.value;
  if (self is AsyncError<T>) return self.previous?.value;
  return null;
}