get<T> method

T? get<T>(
  1. String key
)

Reads key and casts it to T when possible.

Implementation

T? get<T>(String key) {
  _ensureActive();
  final value = _readStatePath(_values, validateStateKey(key));
  final cloned = _cloneStateValue(value);
  return cloned is T ? cloned : null;
}