emitStatements method
Implementation
@override
String emitStatements(
String moduleUrl,
List<o.Statement> stmts,
) {
final srcParts = <String>[];
final converter = _DartEmitterVisitor(
moduleUrl,
emitNullSafeSyntax: emitNullSafeSyntax,
);
final ctx = EmitterVisitorContext.createRoot();
converter.visitAllStatements(stmts, ctx);
converter.importsWithPrefixes.forEach((importedModuleUrl, prefix) {
var importPath = getImportModulePath(moduleUrl, importedModuleUrl);
srcParts.add(prefix.isEmpty
? "import '$importPath';"
: "import '$importPath' as $prefix;");
});
srcParts.add(ctx.toSource());
return srcParts.join('\n');
}