getLocation static method
Future<GeoClueLocation>
getLocation({
- GeoClueManager? manager,
- String? desktopId,
- GeoClueAccuracyLevel? accuracyLevel,
- int? distanceThreshold,
- int? timeThreshold,
Returns the current location or waits for a location update if unknown.
Implementation
static Future<GeoClueLocation> getLocation({
GeoClueManager? manager,
String? desktopId,
GeoClueAccuracyLevel? accuracyLevel,
int? distanceThreshold,
int? timeThreshold,
}) async {
final simple = _GeoClueSimple(manager);
final client = await simple.start(
desktopId: desktopId,
accuracyLevel: accuracyLevel,
distanceThreshold: distanceThreshold,
timeThreshold: timeThreshold,
);
final location = client.location ?? await client.locationUpdated.first;
await simple.stop(client);
return location;
}