dispose method

void dispose(
  1. VChatCloudResult result
)

Implementation

void dispose(VChatCloudResult result) async {
  if (_client.closeCode == null && _client.closeReason == null) {
    try {
      leave();
    } catch (e) {
      if (e is StateError && e.message == "Cannot add event after closing.") {
        // pass;
      }
    }
    _client.sink.close(3000);
  }
  _pingTimer?.cancel();
  _subscription?.cancel();
  _handler.onDisconnect(result);
}