createFileWithContent static method
void
createFileWithContent(
- String path,
- String content, {
- bool canFormated = true,
})
Implementation
static void createFileWithContent(String path, String content,
{bool canFormated = true}) {
final file = File(path);
if (!file.existsSync()) {
file.writeAsStringSync(canFormated
? DartFormatter(languageVersion: DartFormatter.latestLanguageVersion)
.format(content)
: content);
stdout.write(
'${ColorsText.green} ✓${ColorsText.reset} Created file: ${ColorsText.cyan}$path${ColorsText.reset}\n');
}
}