isHeadphonesConnected method

  1. @override
Future<bool> isHeadphonesConnected()
override

Implementation

@override
Future<bool> isHeadphonesConnected() async {
  try {
    final bool isConnected =
    await methodChannel.invokeMethod('isHeadphonesConnected');
    return isConnected;
  } on PlatformException catch (e) {
    print("Failed to check headphones connection: '${e.message}'.");
    return false;
  }
}