flush method

Future<void> flush()

Writes pending changes now instead of at the end of the event-loop turn. Completes once everything set so far is on disk; costs nothing when there is nothing to write.

Implementation

Future<void> flush() {
  if (_pending == null) return _writing ?? Future<void>.value();
  _timer?.cancel();
  _timer = null;
  return _flushNow();
}