writelnQ method Null safety

void writelnQ(
  1. Object object,
  2. {Punctuation delimiter = Punctuation.singleQuotationMark}
)

Encloses obj with delimiter, adds a newline symbol and adds the resulting String to the buffer.

Usage:

final b = StringBuffer();
b.writeQ(1);
b.toString() == '\'1\'\n'

Implementation

void writelnQ(
  Object object, {
  Punctuation delimiter = Punctuation.singleQuotationMark,
}) {
  write(delimiter.value);
  write(object);
  write(delimiter.value);
  write('\n');
}