Skip to content
pubscout

geoclue

0.1.1, released 4 years ago by canonical.com

Dart client for the GeoClue D-Bus geolocation service on Linux.

$ flutter pub add geoclue
Source repository

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.

Works with

Packages commonly used together with geoclue: ones it builds on, ones built on it, and its own family.