dbus_onemw 0.7.3+6 copy "dbus_onemw: ^0.7.3+6" to clipboard
dbus_onemw: ^0.7.3+6 copied to clipboard

LG extension of a native Dart implementation of the D-Bus message bus client.

example/example.dart

import 'package:dbus_onemw/dbus.dart';

void main() async {
  var client = DBusClient.session();
  var object = DBusRemoteObject(client,
      name: 'org.freedesktop.Notifications',
      path: DBusObjectPath('/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')), // Hints
    DBusInt32(-1), // Expire timeout
  ];
  try {
    var result = await object.callMethod(
        'org.freedesktop.Notifications', 'Notify', values,
        replySignature: DBusSignature('u'));
    var id = result.returnValues[0];
    print('notify ${id.toNative()}');
  } on DBusServiceUnknownException {
    print('Notification service not available');
  }
  await client.close();
}
0
likes
120
pub points
43%
popularity

Publisher

unverified uploader

LG extension of a native Dart implementation of the D-Bus message bus client.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MPL-2.0 (license)

Dependencies

args, ffi, meta, stream_channel, web_socket_channel, xml

More

Packages that depend on dbus_onemw