flush method

void flush()

Invokes onFlush with current buffer contents and clears the buffer.

Implementation

void flush() {
  if (_buffer.isEmpty) return;
  onFlush(List<T>.of(_buffer));
  _buffer.clear();
}