getUserSelectedDevices method

Future<List<Device>> getUserSelectedDevices(
  1. DevicePromptOptions options
)

Presents a device picker to the user and returns the Devices selected. If the user cancels the picker devices will be empty. A user gesture is required for the dialog to display. Without a user gesture, the callback will run as though the user cancelled. |options|: Configuration of the device picker dialog box. |callback|: Invoked with a list of chosen Devices.

Implementation

Future<List<Device>> getUserSelectedDevices(
    DevicePromptOptions options) async {
  var $res = await promiseToFuture<JSArray>(
      $js.chrome.usb.getUserSelectedDevices(options.toJS));
  return $res.toDart.cast<$js.Device>().map((e) => Device.fromJS(e)).toList();
}