dispose method

Future<void> dispose()

Call this function to dispose the client

Implementation

Future<void> dispose() async {
  logger.info('Disposing new StreamChatClient');

  // disposing state.
  state.dispose();

  // closing persistence connection.
  await closePersistenceConnection();

  // closing web-socket connection.
  closeConnection();

  await _eventController.close();
  await _wsConnectionStatusController.close();
}