writeApis method

void writeApis(
  1. T generatorOptions,
  2. Root root,
  3. Indent indent, {
  4. required String dartPackageName,
})

Writes all apis to indent.

Can be overridden to add extra code before/after classes.

Implementation

void writeApis(
  T generatorOptions,
  Root root,
  Indent indent, {
  required String dartPackageName,
}) {
  for (final Api api in root.apis) {
    switch (api) {
      case AstHostApi():
        writeHostApi(
          generatorOptions,
          root,
          indent,
          api,
          dartPackageName: dartPackageName,
        );
      case AstFlutterApi():
        writeFlutterApi(
          generatorOptions,
          root,
          indent,
          api,
          dartPackageName: dartPackageName,
        );
      case AstProxyApi():
        writeProxyApi(
          generatorOptions,
          root,
          indent,
          api,
          dartPackageName: dartPackageName,
        );
    }
  }
}