write method
Truncates the file to zero bytes and
then writes the given text to the file.
If newline
is null then no line terminator will
be added.
Implementation
void write(String line, {String? newline = '\n'}) {
final finalline = line + (newline ?? '');
_raf
..truncateSync(0)
..setPositionSync(0)
..flushSync()
..writeStringSync(finalline);
}