writeFunctionDeclaration abstract method
Writes the code for a declaration of a function with the given name.
If a bodyWriter is provided, it will be invoked to write the body of the
function. (The space between the name and the body will automatically be
written.) If isStatic is true, then the declaration will be preceded
by the static keyword. If a nameGroupName is provided, the name of the
function will be included in the linked edit group with that name. If a
returnType is provided, then it will be used as the return type of the
function. If a returnTypeGroupName is provided, then if a return type
was written it will be in the linked edit group with that name. If a
parameterWriter is provided, then it will be invoked to write the
declarations of the parameters to the function. (The parentheses around
the parameters will automatically be written.) If a
typeParameterWriter is provided, then it will be invoked to write the
declarations of the type parameters to the function. (The brackets around
the parameters are not automatically written allowing the function to
determine whether to add them.) If returnType is dynamic, it will be
omitted unless alwaysWriteType is true.
Implementation
void writeFunctionDeclaration(
String name, {
void Function()? bodyWriter,
bool isStatic = false,
String? nameGroupName,
void Function()? parameterWriter,
void Function()? typeParameterWriter,
DartType? returnType,
String? returnTypeGroupName,
List<TypeParameterElement>? typeParametersInScope,
});