writeln method

  1. @override
void writeln([
  1. Object? obj = ''
])
override

Writes the string representation of object followed by a newline.

Equivalent to buffer.write(object) followed by buffer.write("\n").

Notice that calling buffer.writeln(null) will write the "null" string before the newline. Omitting the argument, or explicitly passing an empty string, is the recommended way to emit just the newline.

Implementation

@override
void writeln([Object? obj = '']) {
  write(obj ?? '');
  add([$cr, $lf]);
}