requireValue property
T
get
requireValue
Returns the current value, throwing a StateError if no data is available.
Use this only when you are certain the value exists (e.g. after verifying hasData).
Implementation
T get requireValue {
return switch (this) {
AsyncData<T>(:final value) => value,
_ => throw StateError(
'Cannot get value from $runtimeType — '
'AsyncValue is not AsyncData.',
),
};
}