shutdown method

Future<void> shutdown({
  1. bool flushQueuedEvents = true,
})

Implementation

Future<void> shutdown({bool flushQueuedEvents = true}) async {
  try {
    if (flushQueuedEvents) {
      await flush();
    } else {
      _flushTimer?.cancel();
      _flushTimer = null;
      _queue.clear();
      _offlineQueue.clear();
    }
  } finally {
    close();
  }
}