createFileWithContent static method

void createFileWithContent(
  1. String path,
  2. String content, {
  3. 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');
  }
}