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