writeInjectorGetMethod method

ClassMethod writeInjectorGetMethod()

Implementation

o.ClassMethod writeInjectorGetMethod() {
  final statements = providers?.build() ?? [];
  return o.ClassMethod(
    'injectorGetInternal',
    [
      o.FnParam(InjectMethodVars.token.name!, o.objectType),
      o.FnParam(InjectMethodVars.nodeIndex.name!, o.intType),
      o.FnParam(
        InjectMethodVars.notFoundResult.name!,
        o.objectType.asNullable(),
      ),
    ],
    _addReturnValueIfNotEmpty(statements, InjectMethodVars.notFoundResult),
    o.objectType.asNullable(),
    null,
    [o.importExpr(Identifiers.dartCoreOverride)],
  );
}