getConnectedDevices method

Future<List<Map<String, dynamic>>> getConnectedDevices()

Get list of connected USB devices.

Implementation

Future<List<Map<String, dynamic>>> getConnectedDevices() async {
  try {
    final List<dynamic> devices = await _channel.invokeMethod('getConnectedDevices');
    return devices.cast<Map<String, dynamic>>();
  } on PlatformException catch (e) {
    throw Exception('Failed to get connected devices: ${e.message}');
  }
}