writeClassEncode method
void
writeClassEncode(
- ObjcOptions generatorOptions,
- Root root,
- Indent indent,
- Class klass,
- Set<
String> customClassNames, - Set<
String> customEnumNames, { - required String dartPackageName,
override
Writes a single class encode method to indent
.
Implementation
@override
void writeClassEncode(
ObjcOptions generatorOptions,
Root root,
Indent indent,
Class klass,
Set<String> customClassNames,
Set<String> customEnumNames, {
required String dartPackageName,
}) {
indent.write('- (NSArray *)toList ');
indent.addScoped('{', '}', () {
indent.write('return');
indent.addScoped(' @[', '];', () {
for (final NamedType field in klass.fields) {
indent.writeln(
'${_arrayValue(customClassNames, customEnumNames, field)},');
}
});
});
}