LocationManager class

A manger that knows how to configure and get location. Provide access to location data while the app is in the background.

Use as a singleton:

LocationManager()...

Note that this LocationManager does not handle location permissions. This should be handled and granted on an application level before using probes that depend on location.

Constructors

LocationManager()
Get the singleton LocationManager instance
factory

Properties

enabled bool
Is the location service enabled, which entails that
no setter
hashCode int
The hash code for this object.
no setterinherited
locationManager → Location
final
onLocationChanged Stream<LocationData>
Returns a stream of LocationData objects. Throws an error if the app has no permission to access location.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

configure([LocationService? configuration]) Future<void>
Configures the LocationManager, incl. sending a notification to the Android notification system.
getLastKnownLocation() Future<LocationData>
Get the last known location.
getLocation() Future<LocationData>
Gets the current location of the phone. Throws an error if the app has no permission to access location.
hasPermission() Future<PermissionStatus>
Has the app permission to access location?
isBackgroundModeEnabled() Future<bool>
Is service enabled in background mode?
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
requestPermission() Future<PermissionStatus>
Request permissions to access location?
toString() String
A string representation of this object.
inherited

Operators

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