generateCode method
generate the dart code
Implementation
void generateCode(String className) {
stopWatch();
writeText('start write code');
resourceFile.deleteSync(recursive: true);
resourceFile.createSync(recursive: true);
final StringBuffer source = StringBuffer();
final Template template = Template(className);
source.write(template.license);
source.write(template.classDeclare);
for (final String path in allImageList) {
source.write(template.formatFiled(path, projectRootPath, isPreview));
}
source.write(template.classDeclareFooter);
final Stopwatch sw = Stopwatch();
sw.start();
final String formattedCode = formatFile(source.toString());
sw.stop();
print('format code ${sw.elapsedMilliseconds}ms');
sw.reset();
resourceFile.writeAsString(formattedCode);
sw.stop();
writeText('end write code ${sw.elapsedMilliseconds}');
}