dbus_client 0.0.0-dev.3

  • Readme
  • Changelog
  • Example
  • Installing
  • 63

Native Dart client library for DBus

Changelog #

0.0.0-dev #

  • Initial prerelease

example/example.dart

import 'package:dbus_client/dbus_client.dart';

main() async {
  var client = DBusClient.session();
  await client.connect();
  var values = [
    new DBusString(''),                                           // App name
    new DBusUint32(0),                                            // Replaces
    new DBusString(''),                                           // Icon
    new DBusString('Hello World!'),                               // Summary
    new DBusString(''),                                           // Body
    new DBusArray(new DBusSignature('s')),                        // Actions
    new DBusDict(new DBusSignature('s'), new DBusSignature('v')), // Hints
    new DBusInt32(-1),                                            // Expire timeout
  ];
  var result = await client.callMethod(destination: 'org.freedesktop.Notifications',
                                       path: '/org/freedesktop/Notifications',
                                       interface: 'org.freedesktop.Notifications',
                                       member: 'Notify',
                                       values: values);
  var id = (result[0] as DBusUint32).value;
  print('notify ${id}');
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  dbus_client: ^0.0.0-dev.3

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:dbus_client/dbus_client.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
56
Health:
Code health derived from static analysis. [more]
74
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
65
Overall:
Weighted score of the above. [more]
63
Learn more about scoring.

We analyzed this package on Jan 19, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4

Health issues and suggestions

Document public APIs. (-0.90 points)

287 out of 288 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/dbus_client.dart. (-25 points)

Analysis of lib/dbus_client.dart reported 119 hints, including:

line 106 col 7: DO use curly braces for all flow control structures.

line 130 col 7: DO use curly braces for all flow control structures.

line 165 col 9: DO use curly braces for all flow control structures.

line 181 col 9: DO use curly braces for all flow control structures.

line 183 col 9: DO use curly braces for all flow control structures.

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Package is pre-release. (-5 points)

Pre-release versions should be used with caution; their API can change in breaking ways.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.6.0 <3.0.0
unix_domain_socket ^0.0.0-dev 0.0.0-dev.4
Transitive dependencies
ansicolor 1.0.2
args 1.5.2
collection 1.14.12
console_log_handler 1.1.6
ffi 0.1.3
intl 0.16.1
logging 0.11.4
optional 3.1.0 4.0.1
packages 0.4.4
path 1.6.4