toCloneFunction method

String toCloneFunction(
  1. String className
)

Implementation

String toCloneFunction(String className) {
  final declarations = where((e) => e.name != null).map((e) => e.toCloneDeclaration()).join(',\n').trim();
  final cloneDeclarations = declarations.indented(indent: 2);

  return '$className clone() => $className(\n$cloneDeclarations\n  );';
}