get<T> method
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;
}