writeConstructorDeclaration abstract method
Writes the code for a constructor declaration in the class with the given
className
.
If isConst
is true
, then the constructor will be marked as being a
const
constructor. If a constructorName
is provided, then the
constructor will have the given name. If both a constructor name and a
constructorNameGroupName
is provided, then the name of the constructor
will be included in the linked edit group with that name. If a
parameterWriter
is provided, then it is used to write the constructor
parameters (enclosing parenthesis are written for you). Otherwise, if an
argumentList
is provided then the constructor will have parameters that
match the given arguments. If no argument list is given, but a list of
fieldNames
is provided, then field formal parameters will be created for
each of the field names. If an initializerWriter
is provided then it is
used to write the constructor initializers (the :
prefix is written
for you). If a bodyWriter
is provided then it is used to write the
constructor body, otherwise an empty body is written.
Implementation
void writeConstructorDeclaration(String className,
{ArgumentList? argumentList,
void Function()? bodyWriter,
String? classNameGroupName,
String? constructorName,
String? constructorNameGroupName,
List<String>? fieldNames,
void Function()? initializerWriter,
bool isConst = false,
void Function()? parameterWriter});