sharedStateFor<T> method
Retrieves existing shared state by type and key within the same StateScope. Throws a StateError if no matching shared state is registered.
Implementation
ValueState<T> sharedStateFor<T>({
required Key key,
StateMode mode = .watch,
}) {
return sharedStateOf<T>(
() => throw StateError('No shared state registered for type $T and key $key.'),
key: key,
mode: mode,
);
}