disconnect method

Future<bool> disconnect()

Disconnects the device (if connected).

The ConnectionEvent with type ConnectionType.disconnected is fired after the disconnection has taken place. Returns true if the disconnection was successfully made, false otherwise.

Implementation

Future<bool> disconnect() async {
  _eventStream = null;
  _sensorStream = null;

  return (connected)
      ? await _eSenseManagerMethodChannel.invokeMethod<bool?>('disconnect') ??
          false
      : false;
}