generate method

  1. @override
String generate(
  1. List<ClassMember> members
)

Implementation

@override
String generate(List<ClassMember> members) {
  var patchWith = '';
  if (!enabled) return patchWith;

  for (var member in members) {
    if (!(member is FieldDeclaration)) continue;
    final name = member.fields.variables.first.name.lexeme;
    patchWith += '$name = clone.$name;\n';
  }
  return 'void patchWith($className clone) { $patchWith }';
}