ReportFile constructor

ReportFile(
  1. String path, {
  2. bool echo = true,
})

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:

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);
}