LocationManager class

Provide access to location data while the app is in the background.

Use as a singleton:

LocationManager locationManager = LocationManager.instance;

Properties

accuracy LocationAccuracy
Set the update accuracy. See LocationAccuracy for options.
write-only
distanceFilter double
Set the update distance, i.e. the distance the user needs to move before an update is fired.
write-only
dtoStream Stream<LocationDto>
Getting the stream that provides location data updates
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
interval int
Set the update interval in seconds. Android only.
write-only
isRunning Future<bool>
Get the status of the location manager. Will return true if a location service is currently running.
read-only
notificationMsg ← dynamic
Set the message of the notification for the background service. Android only.
write-only
notificationTitle ← dynamic
Set the title of the notification for the background service. Android only.
write-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

checkIfPermissionGranted() Future<bool>
Check whether or not location permissions have been granted. Location permissions are necessary for getting location updates.
getCurrentLocation() Future<LocationDto>
Get the current location.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
start({bool askForPermission = true}) Future<void>
Start the location service. Will have no effect if it is already running.
stop() Future<void>
Stop the location service. Has no effect if the service is not currently running.
toString() String
A string representation of this object. [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited

Static Properties

instance LocationManager
Get the singleton LocationManager instance
read-only