close method

Future<void> close()

Close this connection

Implementation

Future<void> close() async {
  if (isLogged) {
    chatService.removeOnline(userId, this);
  }
  await subscription.cancel();
  await streamController.close();
  await service.closeListener(this);
}