geoclue
0.1.1, released 4 years ago by canonical.com
Dart client for the GeoClue D-Bus geolocation service on Linux.
What it does
Communicates with the GeoClue D-Bus service to provide geolocation data on Linux systems. It allows fetching current location information as well as listening to continuous location update streams. Geolocation can be derived from various sources including WiFi, GPS, 3G modems, and GeoIP.
AI-written summary of version 0.1.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- Building Linux desktop applications in Dart or Flutter that require location information
- Accessing native Linux geolocation data through the GeoClue D-Bus daemon
Skip it when
- Developing cross-platform applications targeting mobile (iOS/Android) or macOS/Windows
- Running on Linux environments without the GeoClue D-Bus daemon available
Strengths
- Direct integration with the standard Linux desktop geolocation daemon via D-Bus
- Supports both one-off location fetching and reactive location update streams
- Leverages multiple Linux-supported location sources ranging from GPS to GeoIP
Weaknesses
- Strictly limited to Linux platforms
- Requires the host Linux environment to have GeoClue configured and running
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 2
Requires GeoClue and D-Bus installed and accessible on the Linux system, as well as specifying a desktopId.
import 'package:geoclue/geoclue.dart';
Future<void> main() async {
final location = await GeoClue.getLocation(desktopId: 'my_app_id');
print('Current location: $location');
}Alternatives
Packages that do the same job and could replace geoclue.
- geolocator
Pick geolocator if you need a cross-platform location solution covering mobile, web, and desktop platforms.
97Compare
Works with
Packages commonly used together with geoclue: ones it builds on, ones built on it, and its own family.
- dbusgeoclue depends on itNative Dart D-Bus client for Linux and Windows.
- nmSame familyClient for interacting with Linux NetworkManager via D-Bus
- gsettingsSame familyClient to access GSettings database for storing user preferences on Linux.
- upowerSame familyProvides a client to connect to UPower for Linux power management.
- bluezSame familyA Dart client for interacting with the Linux BlueZ Bluetooth stack via D-Bus.
- desktop_notificationsSame familySend Linux desktop notifications via DBus.
- xdg_desktop_portalSame familyA native Dart implementation of portals for Linux desktop applications.
- packagekitSame familyClient for connecting to PackageKit to manage Linux software packages.