writeFileImports method

  1. @override
void writeFileImports(
  1. SwiftOptions generatorOptions,
  2. Root root,
  3. Indent indent, {
  4. required String dartPackageName,
})
override

Writes specified imports to indent.

Implementation

@override
void writeFileImports(
  SwiftOptions generatorOptions,
  Root root,
  Indent indent, {
  required String dartPackageName,
}) {
  indent.writeln('import Foundation');
  indent.newln();
  indent.format('''
#if os(iOS)
import Flutter
#elseif os(macOS)
import FlutterMacOS
#else
#error("Unsupported platform.")
#endif''');
}