equalsBody function
Implementation
String equalsBody(String className, Map<String, bool> parameters) {
final parameterEquals = parameters.entries.fold<String>('true', (value, element) {
final hasDeepCollectionEquality = element.value;
if (hasDeepCollectionEquality) {
return '$value && collectionEquals(this.${element.key},other.${element.key})';
} else {
return '$value && this.${element.key} == other.${element.key}';
}
});
return '''
if (identical(this, other)) return true;
if (other is! $className) return false;
return $parameterEquals;
''';
}