close method

Future<void> close()

Flushes any buffered output and completes once all lines have been appended to the section.

Closes through sink so any data still buffered in it is written before the underlying stream is closed.

Implementation

Future<void> close() async {
  if (_closed) {
    await _done;
    return;
  }
  _closed = true;
  await sink.close();
  await _done;
}