# geoclue 0.1.1

GeoClue: The Geolocation Service




## Installing
```
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.com
flutter pub add geoclue
```
Published: 2022-10-04T07:50:43.987652Z
Expected archive SHA-256: c2a998c77474fc57aa00c6baa2928e58f4b267649057a1c76738656e9dbd2a7f

Available in cache; verification: upstream_checksum
## Direct dependencies
- dbus: ^0.7.3
- meta: ^1.7.0

## Package README (untrusted upstream documentation)
# GeoClue for Dart

[![CI](https://github.com/canonical/geoclue.dart/workflows/Tests/badge.svg)](https://github.com/canonical/geoclue.dart/actions/workflows/tests.yaml)
[![codecov](https://codecov.io/gh/canonical/geoclue.dart/branch/main/graph/badge.svg?token=4GfsNIhvdS)](https://codecov.io/gh/canonical/geoclue.dart)

[GeoClue](https://gitlab.freedesktop.org/geoclue/geoclue/-/wikis/home): 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](https://wiki.mozilla.org/CloudServices/Location) (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)


```dart
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](CONTRIBUTING.md) for more details.

## Changelog
## 0.1.1

- Fix GeoClue.getLocationUpdates()

## 0.1.0

- Initial version.







 
