Skip to content
pubscout

udev

0.0.3, released 4 years ago by canonical.com

API for enumerating and introspecting local devices on Linux using libudev.

$ flutter pub add udev
Source repository

What it does

Provides a Dart interface to libudev for querying, enumerating, and monitoring local devices on Linux systems. Allows filtering devices by subsystems and reading syspaths or device numbers.

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

Use it when

  • You are building a Linux-targeted Flutter or Dart application that needs to interact with hardware devices.
  • You need to monitor local device connection and disconnection events via streams.
  • You need to enumerate system devices and inspect their properties.

Skip it when

  • Your application targets platforms other than Linux, such as Android, iOS, Windows, or macOS.
  • You only need high-level device information without interacting with system-level Linux device management.

Strengths

  • Direct binding to libudev for comprehensive Linux hardware access.
  • Supports stream-based monitoring of device connection events.
  • Simple and straightforward API for querying system paths and device attributes.

Weaknesses

  • Restricted strictly to Linux platforms.
  • Requires proper native system setup and dependencies for libudev.

Setup

Kind
FFI (native library)
Effort
Medium
Code generation
No
Direct dependencies
4

Requires libudev available on the host Linux system and the standard ffi package setup.

final context = UdevContext();

final syspaths = context.enumerateDevices(subsystems: ['usb']);
for (final syspath in syspaths) {
  final device = UdevDevice.fromSyspath(syspath, context: context);
  print(device);
}

Alternatives

Packages that do the same job and could replace udev.

Works with

Packages commonly used together with udev: ones it builds on, ones built on it, and its own family.