onDisconnect method

void onDisconnect(
  1. void callback()
)
inherited

Set callback when the device is disconnected

Implementation

void onDisconnect(void Function() callback) {
  onDisconnectCallback = () {
    _pingTimer?.cancel();
    _powerTimer?.cancel();
    callback();
  };
}