writeToSink method

void writeToSink(
  1. StringSink sink
)

Implementation

void writeToSink(StringSink sink) {
  final emmiter = DartEmitter(
    orderDirectives: true,
    useNullSafetySyntax: true,
  );

  final library = Library((builder) {
    builder.directives = _directives;
    builder.body = _body;
  });

  sink.write(library.accept(emmiter));
}