geoclue 0.1.1 copy "geoclue: ^0.1.1" to clipboard
geoclue: ^0.1.1 copied to clipboard

PlatformLinux

GeoClue: The Geolocation Service

GeoClue for Dart #

CI codecov

GeoClue: The Geolocation Service

Geoclue is a D-Bus service that provides location information. It utilizes many sources to best find user's location:

  • WiFi-based geolocation via Mozilla Location Service (accuracy: in meters)
  • GPS(A) receivers (accuracy: in centimeters)
  • GPS of other devices on the local network, e.g smartphones (accuracy: in centimeters)
  • 3G modems (accuracy: in kilometers, unless modem has GPS)
  • GeoIP (accuracy: city-level)
import 'dart:async';

import 'package:geoclue/geoclue.dart';

Future<void> main() async {
  final location = await GeoClue.getLocation(desktopId: '<desktop-id>');
  print('Current location: $location');

  print('Waiting 10s for location updates...');
  late final StreamSubscription sub;
  sub = GeoClue.getLocationUpdates(desktopId: '<desktop-id>')
      .timeout(const Duration(seconds: 10), onTimeout: (_) => sub.cancel())
      .listen((location) {
    print('... $location');
  });
}

Contributing to geoclue.dart #

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

4
likes
150
points
3.14k
downloads

Publisher

verified publishercanonical.com

Weekly Downloads

GeoClue: The Geolocation Service

Homepage
Repository (GitHub)
View/report issues
Contributing

Documentation

API reference

License

MPL-2.0 (license)

Dependencies

dbus, meta

More

Packages that depend on geoclue