find<S> method
Retrieves an instance of type S.
Implementation
S find<S>({String? tag}) {
final key = _getKey(S, tag);
if (_factories.containsKey(key)) {
final dep = _factories[key]!;
final instance = dep.getDependency() as S;
if (!dep.isInit) {
dep.isInit = true;
if (instance is GetLifeCycleMixin) {
instance.onStart();
}
}
return instance;
}
throw InstanceNotFoundException(
'Instance "$S" with tag "$tag" not found in GetContainer.',
);
}