toStringBody function

String toStringBody(
  1. String className,
  2. Iterable<String> fields
)

Implementation

String toStringBody(String className, Iterable<String> fields) {
  final fieldsToString = fields.fold('', (r, field) => r + '$field=\${this.$field},');
  return "return '$className($fieldsToString)';";
}