toCopyWith method

String toCopyWith(
  1. String className
)

Implementation

String toCopyWith(String className) {
  var constructorDeclarations =
      where((e) => e.name != null).map((e) => e.copyWithConstructorDeclaration()).join(',\n').trim();
  constructorDeclarations = ModelTemplates.indented(constructorDeclarations);

  var bodyDeclarations = where((e) => e.name != null).map((e) => e.copyWithBodyDeclaration()).join(',\n').trim();
  bodyDeclarations = ModelTemplates.indented(bodyDeclarations);

  return ModelTemplates.indented('$className copyWith({\n'
      '$constructorDeclarations\n'
      '}) => $className(\n'
      '$bodyDeclarations,\n'
      ');');
}