Search packages, repositories and app categories

Package detailsv0.7.0

upower

Provides a client to connect to UPower - the service that does power management on Linux.

Linux
30-day downloads
564K
Likes
8
Pub points
150

Install package

flutter pub add upower

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The upower package provides a Dart client for connecting to UPower, a Linux system service responsible for power management. It enables Flutter applications running on Linux to access battery status, power supply information, and device charging states. This integration allows developers to build desktop apps that monitor and respond to power-related events in real time. The package is maintained by Canonical and is specifically designed for Linux environments, offering a lightweight way to interact with system-level power data through the D-Bus interface.

Use cases

  • Monitoring battery levels in Linux desktop apps
  • Detecting power supply changes (AC/DC)
  • Building energy-efficient applications
  • Displaying real-time charge status
  • Integrating with system power management tools

Key features

  • Linux-only platform support
  • D-Bus integration via UPower service
  • Real-time power state updates
  • Simple API for battery and charger info
  • Maintained by Canonical

Suitable for

  • Linux desktop app developers
  • Power-aware application creators
  • System monitoring tools
  • Battery status display utilities
  • Dart-based Linux utilities

Considerations

  • Limited to Linux platforms
  • Requires UPower service to be running
  • No support for Windows or macOS
  • Depends on D-Bus availability
  • May need elevated permissions for full access

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Pub Package codecov

Provides a client to connect to UPower - the service that does power management on Linux.

import 'package:upower/upower.dart';

var client = UPowerClient();
await client.connect();
print('Running UPower ${client.daemonVersion}');
print('System state: ${client.displayDevice.state}');
print('Devices:');
for (var device in client.devices) {
  print('  ${device.type} ${device.percentage}%');
}
await client.close();

Contributing to upower.dart

We welcome contributions! See the contribution guide for more details.

Categories

Dependencies

Dependency list 1 items

Source repository

Projects using this package