diff --git a/README.md b/README.md index c31d937..e935d85 100644 --- a/README.md +++ b/README.md @@ -151,6 +151,14 @@ Geolocation offers three methods: https://pub.dartlang.org/documentation/geolocation/0.2.1/geolocation/Geolocation/currentLocation.html ```dart +// get last known location, which is a future rather than a stream (best for android) +LocationResult result = await Geolocation.lastKnownLocation(); + +// force a single location update (best for ios) +StreamSubscription subscription = Geolocation.currentLocation(accuracy: LocationAccuracy.best).listen((result) { + // todo with result +}); + // best option for most cases StreamSubscription subscription = Geolocation.currentLocation(accuracy: LocationAccuracy.best).listen((result) { if(result.isSuccessful) { @@ -158,14 +166,6 @@ StreamSubscription subscription = Geolocation.currentLocation(ac // todo with result } }); - -// force a single location update -StreamSubscription subscription = Geolocation.currentLocation(accuracy: LocationAccuracy.best).listen((result) { - // todo with result -}); - -// get last known location, which is a future rather than a stream -LocationResult result = await Geolocation.lastKnownLocation(); ``` ### Continuous location updates