writeFileImports method

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

Writes specified imports to indent.

Implementation

@override
void writeFileImports(
  ObjcOptions generatorOptions,
  Root root,
  Indent indent, {
  required String dartPackageName,
}) {
  indent.writeln('#import "${generatorOptions.headerIncludePath}"');
  indent.newln();
  indent.writeln('#if TARGET_OS_OSX');
  indent.writeln('#import <FlutterMacOS/FlutterMacOS.h>');
  indent.writeln('#else');
  indent.writeln('#import <Flutter/Flutter.h>');
  indent.writeln('#endif');
  indent.newln();

  indent.writeln('#if !__has_feature(objc_arc)');
  indent.writeln('#error File requires ARC to be enabled.');
  indent.writeln('#endif');
  indent.newln();
}