writeFile static method
Function that writes file to the disk
path
has to be a fully qualified path
content
is the raw file contents as string
Implementation
static void writeFile(
String path,
String content,
) {
try {
final _file = File(DirectoryService.replaceAsExpected(path: path));
_file.createSync(recursive: true);
_file.writeAsStringSync(content);
LogService.success('Created $path');
} on FileSystemException catch (err) {
LogService.error('${err.message} -> ${'$path'}');
}
}