writeFlutterApi method
void
writeFlutterApi(
- ObjcOptions generatorOptions,
- Root root,
- Indent indent,
- Api api, {
- required String dartPackageName,
override
Writes a single Flutter Api to indent
.
Implementation
@override
void writeFlutterApi(
ObjcOptions generatorOptions,
Root root,
Indent indent,
Api api, {
required String dartPackageName,
}) {
assert(api.location == ApiLocation.flutter);
final String apiName = _className(generatorOptions.prefix, api.name);
_writeCodecAndGetter(generatorOptions, root, indent, api);
_writeExtension(indent, apiName);
indent.newln();
indent.writeln('@implementation $apiName');
indent.newln();
_writeInitializer(indent);
for (final Method func in api.methods) {
_writeMethod(
generatorOptions,
root,
indent,
api,
func,
dartPackageName: dartPackageName,
);
}
indent.writeln('@end');
indent.newln();
}