find<S> method

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

Resolves a dependency of type S from the current or parent scope.

Implementation

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