append method

Future<void> append(
  1. String line, {
  2. String? newline,
})

Appends the line to the file Appends newline after the line. If newline is null or isn't passed then the platform end of line characters are appended as defined by Platform().eol. Pass null or an '' to newline to not add a line terminator.

Implementation

Future<void> append(String line, {String? newline}) async {
  final finalline = line + (newline ?? Platform().eol);

  (await _raf)
    ..setPositionSync((await _raf).lengthSync())
    ..writeStringSync(finalline);
}