dbus_client 0.0.0-dev.11

[discontinued]

A native Dart implementation of the D-Bus message bus client. This package allows Dart applications to directly access services on the Linux desktop.

example/example.dart

import 'package:dbus/dbus.dart';
import 'dart:collection';

void main() async {
  var client = DBusClient.session();
  await client.connect();
  var proxy = DBusObjectProxy(client, 'org.freedesktop.Notifications',
      '/org/freedesktop/Notifications');
  var values = [
    DBusString(''), // App name
    DBusUint32(0), // Replaces
    DBusString(''), // Icon
    DBusString('Hello World!'), // Summary
    DBusString(''), // Body
    DBusArray(DBusSignature('s'), []), // Actions
    DBusDict(DBusSignature('s'), DBusSignature('v'),
        LinkedHashMap<DBusValue, DBusValue>()), // Hints
    DBusInt32(-1), // Expire timeout
  ];
  var result =
      await proxy.callMethod('org.freedesktop.Notifications', 'Notify', values);
  var id = (result.returnValues[0] as DBusUint32).value;
  print('notify ${id}');
  await client.disconnect();
}
3
likes
0
pub points
48%
popularity

A native Dart implementation of the D-Bus message bus client. This package allows Dart applications to directly access services on the Linux desktop.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploaders

marcus.tomlinson@canonical.com
robert.ancell@canonical.com

More

Packages that depend on dbus_client