dbus
0.8.1, released yesterday by canonical.com
Native Dart D-Bus client for Linux and Windows.
What it does
Provides a pure Dart implementation of the D-Bus message bus client, allowing Dart applications to access services on the Linux desktop or Windows via FFI. It supports code generation from XML interface definitions and direct API usage.
AI-written summary of version 0.8.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- Accessing Linux desktop services via D-Bus
- Building D-Bus clients in Dart
- Generating Dart bindings from D-Bus XML interfaces
Skip it when
- Running on macOS or other non-Linux/Windows platforms
- When you only need a simple HTTP or WebSocket client
Strengths
- Native performance through FFI
- Supports code generation for clean APIs
- Cross-platform support for Linux and Windows
Weaknesses
- Only works on Linux and Windows
- Requires native FFI setup
- No support for macOS or other platforms
Setup
- Kind
- FFI (native library)
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 4
Add dependency, ensure libdbus (Linux) or equivalent on Windows is available, no build_runner needed.
import 'package:dbus/dbus.dart';
Future<void> main() async {
var client = DBusClient.session();
var object = DBusRemoteObject(client, name: 'com.example.Test', path: DBusObjectPath('/com/example/Test/Object'));
var version = await object.getProperty('com.example.Test', 'Version', signature: DBusSignature('s')).then((v)=>v.asString());
print('version: $version');
await client.close();
}Alternatives
Packages that do the same job and could replace dbus.
- cronet_http
An Android Flutter plugin providing access to the Cronet HTTP client.
87Compare - stream_chat
Low‑level Dart client for Stream Chat API
91Compare - bonsoir
A Zeroconf library to discover network services and broadcast your own.
88Compare - aws_client
Strongly-typed Dart client libraries for accessing Amazon Web Services (AWS) APIs.
86Compare
Works with
Packages commonly used together with dbus: ones it builds on, ones built on it, and its own family.
- xmldbus depends on itFull-featured XML and XPath library for DOM parsing, SAX streaming, and fluent building.
- ffidbus depends on itUtilities for working with Foreign Function Interface (FFI) code in Dart.
- argsdbus depends on itLibrary for parsing raw command-line arguments into options and values using GNU and POSIX styles.
- nmBuilt on dbusClient for interacting with Linux NetworkManager via D-Bus
- flutter_local_notifications_linuxBuilt on dbusLinux implementation of the flutter_local_notifications plugin.
- wakelock_plusBuilt on dbusKeep the device screen awake across mobile, desktop, and web platforms.
- gsettingsBuilt on dbusClient to access GSettings database for storing user preferences on Linux.
- geoclueBuilt on dbusDart client for the GeoClue D-Bus geolocation service on Linux.