requireData property

T get requireData

Returns the data. An error is thrown if data is null.

Implementation

T get requireData {
  if (hasData) return data!;
  if (hasError) Error.throwWithStackTrace(error!, stackTrace!);
  throw StateError('Snapshot has neither data nor error.');
}