ReportFile constructor
Creates or truncates the file at path.
Parameters:
path: the file to write; parent folders are created.echo: whether to also write everything to stdout.
Throws:
- FileSystemException if the file cannot be opened.
Implementation
factory ReportFile(String path, {bool echo = true}) {
final file = File(path);
file.parent.createSync(recursive: true);
return ReportFile._(file.openSync(mode: FileMode.writeOnly), echo);
}