writeLocalVariableDeclaration abstract method
Writes 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
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,
});