getState<S> method

S getState<S>(
  1. S dependency, {
  2. String? tag,
  3. bool permanent = true,
})

Implementation

S getState<S>(
  S dependency, {
  String? tag,
  bool permanent = true,
}) {
  final key = _getKey(S, tag);

  if (_singl.containsKey(key)) {
    return _singl[key]!.getDependency() as S;
  } else {
    return put(dependency, tag: tag, permanent: permanent);
  }
}