Skip to content
pubscout

usb_device

1.0.2, released 4 years ago by apparence.io

Flutter plugin to communicate with USB devices on the web using the WebUSB API.

$ flutter pub add usb_device
Source repository

What it does

Provides access to USB devices from Flutter Web using the official WebUSB API. Allows pairing devices with filters, sending and receiving data, and managing device configurations and sessions.

AI-written summary of version 1.0.2, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to interact with USB devices directly from a Flutter Web application
  • You need to send and receive data via USB transfer methods on supported web browsers

Skip it when

  • You need to target Android, iOS, macOS, Windows, or Linux (this plugin currently only supports the web platform)
  • You need a cross-platform solution for desktop and mobile USB communication

Strengths

  • Integrates directly with the official WebUSB API
  • Supports device pairing, filtering, control transfers, and isochronous transfers
  • Includes connection and disconnection callbacks

Weaknesses

  • Platform support is limited to Web only
  • Requires browser support for WebUSB

Setup

Kind
Plugin (native code)
Effort
Low
Code generation
No
Direct dependencies
2

Add the dependency to your pubspec.yaml and import the package. Ensure the browser supports WebUSB.

import 'package:usb_device/usb_device.dart';

final UsbDevice usbDevice = UsbDevice();

// get paired devices
final pairedDevices = await usbDevice.pairedDevices;

Alternatives

Packages that do the same job and could replace usb_device.