License: MIT pub dev webusb

USB Device plugin logo

Developed with 💙  by

This plugin provide access to USB devices from web pages with WebUSB.

Platform Support



import 'package:usb_device/usb_device.dart';

final UsbDevice usbDevice = UsbDevice();

var pairedDevices = await usbDevice.pairedDevices; // get paired devices
var pairedDevice = await usbDevice.requestDevices([DeviceFilter(vendorId : 0x00, productId: 0x00)]); // par a device 
List<USBConfiguration> availableConfigurations = await usbDevice.getAvailableConfigurations(pairedDevice); // get device's configurations 
USBDeviceInfo deviceInfo = await usbDevice.getPairedDeviceInfo(pairedDevice); // get device's info
await; // start session
await usbDevice.close(pairedDevice); // close session



  • x getDevices() : Get paired attached devices
  • x requestDevice(filters): pair a device with filter or not


  • x Get device info with configuration
  • x open(): Start session
  • x close(): Close session
  • x selectConfiguration(configurationValue): Select a specified configuration
  • x claimInterface(interfaceNumber): Claim an interface for exclusive access
  • x releaseInterface(interfaceNumber): Release a claimed interface
  • x controlTransferIn(setup, length): Return result of a command
  • x controlTransferOut(setup, data) : Send a command to device
  • x transferIn(): Return data from device
  • x transferOut(): Send data to device
  • x clearHalt()
  • x reset(): Reset device
  • x isochronousTransferIn()
  • x isochronousTransferOut()


  • x OnConnect
  • x OnDisconnect