You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import 'package:dbus/dbus.dart';
class OrgFreedesktopUPowerDevicesDisplayDevice extends DBusRemoteObject {
OrgFreedesktopUPowerDevicesDisplayDevice(
DBusClient client, String destination,
{DBusObjectPath path = const DBusObjectPath.unchecked(
'/org/freedesktop/UPower/devices/DisplayDevice')})
: super(client, destination, path);
/// Gets org.freedesktop.UPower.Device.Percentage
Future<double> get percentage async {
var value =
await getProperty('org.freedesktop.UPower.Device', 'Percentage');
return (value as DBusDouble).value;
}
/// Subscribes to org.freedesktop.UPower.Device.State
Future<DBusSignalSubscription> subscribeState(
void Function() callback) async {
return await subscribeSignal('org.freedesktop.UPower.Device', 'State',
(values) {
if (values.length != 0) {
callback();
}
});
}
}
I want to return a Stream from plugin which states the status of battery in linux platform but can't find any documentation to implement it or a method to get it's value from generated subscribeState function.
The text was updated successfully, but these errors were encountered:
I am working on a plugin which fetches battery percentage and status from linux platform. It's dbus interface definition is :
And generated dart file is :
I want to return a Stream from plugin which states the status of battery in linux platform but can't find any documentation to implement it or a method to get it's value from generated
subscribeState
function.The text was updated successfully, but these errors were encountered: