getCurrentState property

Future<HeadsetState?> get getCurrentState

Implementation

Future<HeadsetState?> get getCurrentState async {
  final state = await _channel.invokeMethod<int?>('getCurrentState');

  switch (state) {
    case 0:
      return HeadsetState.DISCONNECT;
    case 1:
      return HeadsetState.CONNECT;
    default:
      return HeadsetState.DISCONNECT;
  }
}