find<S> method
Resolves a dependency of type S or identified by key or tag.
Implementation
S find<S>({dynamic key, String? tag}) {
if (key is LevitStore) {
final scope = _ScopeProvider.of(_context) ?? Ls.currentScope;
return key.findIn(scope, tag: tag) as S;
}
if (key is LevitAsyncStore) {
final scope = _ScopeProvider.of(_context) ?? Ls.currentScope;
return key.findIn(scope, tag: tag) as S;
}
final scope = _ScopeProvider.of(_context);
if (scope != null) {
return scope.find<S>(tag: tag);
}
return Levit.find<S>(tag: tag);
}