append method

void append(
  1. String line, {
  2. String newline = '\n',
})

Treat the contents of this String as the name of a file and append line to the file. newline specifies the line termination character. If you don't want a newline appended then pass an empty string to newline. newline defaults to '\n'.

e.g.

'.bashrc'.append('export FRED=ONE');

Implementation

void append(String line, {String newline = '\n'}) {
  FileSync(this)
    ..append(line, newline: newline)
    ..close();
}