toggle method

void toggle(
  1. String port
)

Either connects or disconnects the device on the given port.

Implementation

void toggle(String port) => isConnected(port) ? disconnect(port) : connect(port);