visitTopLevelFunctionElement method
Visits a top-level function element and extracts its documentation.
Implementation
@override
void visitTopLevelFunctionElement(TopLevelFunctionElement element) {
components.add(DocComponent(
name: element.name3!,
filePath: filePath,
isNullSafe: true,
description: _getDescription(element),
constructors: [],
properties: [],
methods: [
DocMethod(
name: element.name3!,
returnType: element.returnType.toString(),
description: _getDescription(element),
signature: _mapParameters(element.formalParameters),
features: [
if (element.isStatic) "static",
if (element.isExternal) "external",
],
annotations: _getAnnotations(element),
)
],
type: DocComponentType.functionType,
annotations: _getAnnotations(element),
));
super.visitTopLevelFunctionElement(element);
}