getState<S> method

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

Implementation

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

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