udev
0.0.3, released 4 years ago by canonical.com
API for enumerating and introspecting local devices on Linux using libudev.
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.
- platform_device_id
Get unique device IDs across Android, iOS, Windows, Linux, macOS, and Web.
50Compare - app_launcher
Launches an installed Android app by its package ID, falling back to Google Play if missing.
46Compare - platform_device_id_plus
Get a unique device identifier across Android, iOS, Windows, macOS, Linux, and Web.
41Compare - flutter_screen_wake
Manage device screen wake state and brightness on Android and iOS.
40Compare
Works with
Packages commonly used together with udev: ones it builds on, ones built on it, and its own family.