deactivate method

  1. @override
Future<void> deactivate()

Instructs the driver to deactivate and disconnect from any external source.

Implementation

@override
Future<void> deactivate() async {
  _active = false;
  await _commandStreamController?.close();
  _commandStreamController = null;
  _commandQueue.clear();

  await _channelSubscription?.cancel();
  _channelSubscription = null;

  _commandTimer?.cancel();
  _commandTimer = null;

  _pingTimer?.cancel();
  _pingTimer = null;

  _reconnectTimer?.cancel();
  _reconnectTimer = null;

  _timer?.cancel();
  _timer = null;

  if (_onConnectionChanged != null) {
    await _onConnectionChanged!(this, false);
  }
}