writeFlutterApi method

  1. @override
void writeFlutterApi(
  1. ObjcOptions generatorOptions,
  2. Root root,
  3. Indent indent,
  4. Api api, {
  5. 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();
}