generate method
Write the generated code described in root
to sink
using the options
.
Implementation
@override
void generate(
StringSink sink, PigeonOptions options, Root root, FileType fileType) {
final GObjectOptions gobjectOptions =
options.gobjectOptions ?? const GObjectOptions();
final GObjectOptions gobjectOptionsWithHeader =
gobjectOptions.merge(GObjectOptions(
copyrightHeader: options.copyrightHeader != null
? _lineReader(
path.posix.join(options.basePath ?? '', options.copyrightHeader))
: null,
));
final OutputFileOptions<GObjectOptions> outputFileOptions =
OutputFileOptions<GObjectOptions>(
fileType: fileType, languageOptions: gobjectOptionsWithHeader);
const GObjectGenerator generator = GObjectGenerator();
generator.generate(
outputFileOptions,
root,
sink,
dartPackageName: options.getPackageName(),
);
}