getState<T> method

Rx<T> getState<T>(
  1. String key
)

Get state from this scope

Implementation

Rx<T> getState<T>(String key) {
  if (_disposed) {
    throw StateError('Scope "$id" has been disposed');
  }
  final state = _state[key];
  if (state == null) {
    throw StateError('State with key "$key" not found in scope "$id"');
  }
  return state as Rx<T>;
}