writeLocalVariableDeclaration abstract method

void writeLocalVariableDeclaration(
  1. String name, {
  2. void initializerWriter()?,
  3. bool isConst = false,
  4. bool isFinal = false,
  5. String? nameGroupName,
  6. DartType? type,
  7. String? typeGroupName,
})

Write the code for a declaration of a local variable with the given name. If an initializerWriter is provided, it will be invoked to write the content of the initializer. (The equal sign separating the variable name from the initializer expression will automatically be written.) If isConst is true, then the declaration will be preceded by the const keyword. If isFinal is true, then the declaration will be preceded by the final keyword. (If both isConst and isFinal are true, then only the const keyword will be written.) If a nameGroupName is provided, the name of the variable will be included in the linked edit group with that name. If a type is provided, then it will be used as the type of the variable. (The keyword var will be provided automatically when required.) If a typeGroupName is provided, then if a type was written it will be in the linked edit group with that name.

Implementation

void writeLocalVariableDeclaration(String name,
    {void Function()? initializerWriter,
    bool isConst = false,
    bool isFinal = false,
    String? nameGroupName,
    DartType? type,
    String? typeGroupName});