LocationSettings class
LocationSettings is used to change the settings of the next location request.
Constructors
- LocationSettings({bool askForPermission = true, String rationaleMessageForPermissionRequest = 'The app needs to access your location', String rationaleMessageForGPSRequest = 'The app needs to access your location', bool useGooglePlayServices = true, bool askForGooglePlayServices = false, bool askForGPS = true, bool fallbackToGPS = true, bool ignoreLastKnownPosition = false, double? expirationDuration, double? expirationTime, double fastestInterval = 500, double interval = 1000, double? maxWaitTime, int? numUpdates, double? acceptableAccuracy, LocationAccuracy accuracy = LocationAccuracy.high, double smallestDisplacement = 0, bool waitForAccurateLocation = true})
- LocationSettings is used to change the settings of the next location request.
Properties
- acceptableAccuracy ↔ double?
-
The accptable accuracy of the location request.
Only valid on Android.
getter/setter pair
- accuracy ↔ LocationAccuracy
-
The accuracy of the location request.
getter/setter pair
- askForGooglePlayServices ↔ bool
-
If set to true, the app will request Google Play Services to request location.
If not available on the device, the app will fallback to GPS.
getter/setter pair
- askForGPS ↔ bool
-
If set to true, the app will request GPS to request location.
Only valid on Android.
getter/setter pair
- askForPermission ↔ bool
-
If set to true, the user will be prompted to grant permission to use location
if not already granted.
getter/setter pair
- expirationDuration ↔ double?
-
The duration of the location request.
Only valid on Android.
getter/setter pair
- expirationTime ↔ double?
-
The expiration time of the location request.
Only valid on Android.
getter/setter pair
- fallbackToGPS ↔ bool
-
If set to true, the app will fallback to GPS if Google Play Services is not
available on the device.
Only valid on Android.
getter/setter pair
- fastestInterval ↔ double
-
The fastest interval between location updates.
In milliseconds.
Only valid on Android.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- ignoreLastKnownPosition ↔ bool
-
If set to true, the app will ignore the last known position
and request a fresh one
getter/setter pair
- interval ↔ double
-
The interval between location updates.
In milliseconds.
getter/setter pair
- maxWaitTime ↔ double?
-
The maximum amount of time the app will wait for a location.
In milliseconds.
getter/setter pair
- numUpdates ↔ int?
-
The number of location updates to request.
Only valid on Android.
getter/setter pair
- rationaleMessageForGPSRequest ↔ String
-
The message to display to the user when asking for permission to use GPS.
Only valid on Android.
getter/setter pair
- rationaleMessageForPermissionRequest ↔ String
-
The message to display to the user when asking for permission to use location.
Only valid on Android.
For iOS, you have to change the permission in the Info.plist file.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- smallestDisplacement ↔ double
-
The smallest displacement between location updates.
getter/setter pair
- useGooglePlayServices ↔ bool
-
If set to true, the app will use Google Play Services to request location.
If not available on the device, the app will fallback to GPS.
Only valid on Android.
getter/setter pair
- waitForAccurateLocation ↔ bool
-
If set to true, the app will wait for an accurate location.
Only valid on Android.
getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toPigeon(
) → PigeonLocationSettings - Converts to the Pigeon equivalent.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited