find<S> static method

S find<S>({
  1. dynamic key,
  2. String? tag,
})

Resolves a dependency of type S or identified by key or tag.

Throws an Exception if no registration is found.

Implementation

static S find<S>({dynamic key, String? tag}) {
  if (key is LevitState) {
    return key.findIn(Ls.currentScope, tag: tag) as S;
  }
  return Ls.find<S>(tag: tag);
}