requireData property

T get requireData

Returns the stored data or throws when no data is present.

Implementation

T get requireData {
  if (!hasData) throw StateError('Query has no data.');
  return data as T;
}