getFunction method

  1. @override
FunctionElement? getFunction(
  1. String name
)
override

Returns the function with the given name, or null if this library does not have a function with the given name.

Implementation

@override
FunctionElement? getFunction(String name) {
  if (_didResolveAllFunctions || hasElement(name)) {
    return _elementsOfType<FunctionElement>().firstWhereOrNull((FunctionElement e) => e.name == name);
  }
  resolver.resolveFunctions(this, predicate: (FunctionDeclaration e) => e.name.lexeme == name);
  return _elementsOfType<FunctionElement>().firstWhereOrNull((FunctionElement e) => e.name == name);
}