writeFlutterApi method

  1. @override
void writeFlutterApi(
  1. ObjcOptions generatorOptions,
  2. Root root,
  3. Indent indent,
  4. AstFlutterApi api, {
  5. required String dartPackageName,
})
override

Writes a single Flutter Api to indent.

Implementation

@override
void writeFlutterApi(
  ObjcOptions generatorOptions,
  Root root,
  Indent indent,
  AstFlutterApi api, {
  required String dartPackageName,
}) {
  final String apiName = _className(generatorOptions.prefix, api.name);

  _writeExtension(indent, apiName);
  indent.newln();
  indent.writeln('@implementation $apiName');
  indent.newln();
  _writeInitializers(indent);
  for (final Method func in api.methods) {
    _writeMethod(
      generatorOptions,
      root,
      indent,
      api,
      func,
      dartPackageName: dartPackageName,
    );
  }
  indent.writeln('@end');
  indent.newln();
}