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