State class
Expresses the current state of the plugin, including all Config options.
Properties
- activityRecognitionInterval ↔ int?
-
Controls the sample-rate of the activity-recognition system.
getter/setter pairinherited
- activityType ↔ int?
-
[iOS only]
Presumably, this affects iOS stop-detect algorithm. Apple is vague about what exactly this option does.getter/setter pairinherited - allowIdenticalLocations ↔ bool?
-
[Android only]
Allow recording locations which are duplicates of the previous.getter/setter pairinherited -
Configure the SDK's HTTP service to authenticate with your server (eg: JWT)
getter/setter pairinherited
- autoSync ↔ bool?
-
Immediately upload each recorded location to your configured url.
getter/setter pairinherited
- autoSyncThreshold ↔ int?
-
The minimum number of persisted records the plugin must accumulate before triggering an autoSync action.
getter/setter pairinherited
- backgroundPermissionRationale ↔ PermissionRationale?
-
(Android 11+) Configure the dialog presented to the user when Always location permission is requested.
getter/setter pairinherited
- batchSync ↔ bool?
-
POST multiple locations to your url in a single HTTP request.
getter/setter pairinherited
- debug ↔ bool?
-
Configure the plugin to emit sound effects and local-notifications during development.
getter/setter pairinherited
- deferTime ↔ int?
-
[Android only]
Sets the maximum wait time in milliseconds for location updates.getter/setter pairinherited - desiredAccuracy ↔ int?
-
Specify the desired-accuracy of the geolocation system.
getter/setter pairinherited
- desiredOdometerAccuracy ↔ double?
-
The maximum location accuracy allowed for a location to be used for Location.odometer calculations.
getter/setter pairinherited
- didDeviceReboot ↔ bool
-
Indicates if the app was launched after the device was rebooted.
getter/setter pair
- didLaunchInBackground ↔ bool
-
Indicates whether the iOS app was launched in the background.
getter/setter pair
- disableAutoSyncOnCellular ↔ bool?
-
Disable autoSync HTTP requests when device is connected to a Cellular connection.
Defaults to
false
. Settrue
to allow autoSync only when device is connected to Wifi.getter/setter pairinherited - disableElasticity ↔ bool?
-
Disable automatic, speed-based distanceFilter scaling.
getter/setter pairinherited
- disableLocationAuthorizationAlert ↔ bool?
-
Disables automatic authorization alert when plugin detects the user has disabled location authorization.
getter/setter pairinherited
- disableMotionActivityUpdates ↔ bool?
-
Disable the plugin requesting "Motion & Fitness" (ios) or "Physical Activity" (android >= 10) authorization from the User.
getter/setter pairinherited
- disableProviderChangeRecord ↔ bool?
-
[Android-only]
Disables the automatic insert of a location record into the SDK's SQLite database and subsequent HTTP upload if configured with Config.url. When aonProviderChange
event fires, the Android SDK has traditionally recorded a location to show exactly when and where the state of location-services was changed (eg: Location-services disabled).getter/setter pairinherited - disableStopDetection ↔ bool?
-
Disable motion-activity related stop-detection.
getter/setter pairinherited
- distanceFilter ↔ double?
-
The minimum distance (measured in meters) a device must move horizontally before an update event is generated.
getter/setter pairinherited
- elasticityMultiplier ↔ double?
-
Controls the scale of automatic speed-based distanceFilter elasticity.
getter/setter pairinherited
- enabled ↔ bool
-
Whether the plugin is current stopped or started (BackgroundGeolocation.stop / BackgroundGeolocation.start).
getter/setter pair
- enableHeadless ↔ bool?
-
[Android only]
Enables "Headless" operation allowing you to respond to events after you app has been terminated with stopOnTerminate:false.getter/setter pairinherited - enableTimestampMeta ↔ bool?
-
Enable extra timestamp meta data to be appended to each recorded location, including system-time.
getter/setter pairinherited
-
extras
↔ Map<
String, dynamic> ? -
Optional arbitrary key/values
{}
applied to each recorded location.getter/setter pairinherited - fastestLocationUpdateInterval ↔ int?
-
[Android only]
Explicitly set the fastest interval for location updates, in milliseconds.getter/setter pairinherited - forceReloadOnBoot ↔ bool?
-
@deprecated: Banned in Android 10. Use enableHeadless instead
getter/setter pairinherited
- forceReloadOnGeofence ↔ bool?
-
@deprecated: Banned in Android 10. Use enableHeadless instead
getter/setter pairinherited
- forceReloadOnHeartbeat ↔ bool?
-
@deprecated: Banned in Android 10. Use enableHeadless instead
getter/setter pairinherited
- forceReloadOnLocationChange ↔ bool?
-
@deprecated: Banned in Android 10. Use enableHeadless instead
getter/setter pairinherited
- forceReloadOnMotionChange ↔ bool?
-
@deprecated: Banned in Android 10. Use enableHeadless instead
Force launch your terminated App after a BackgroundGeolocation.onMotionChange event.
getter/setter pairinherited
- forceReloadOnSchedule ↔ bool?
-
@deprecated: Banned in Android 10. Use enableHeadless instead
getter/setter pairinherited
- foregroundService ↔ bool?
-
[Android only]
Configure the plugin service to run as a more robust "Foreground Service".getter/setter pairinherited - geofenceInitialTriggerEntry ↔ bool?
-
When a device is already within a just-created geofence, fire the enter transition immediately.
getter/setter pairinherited
- geofenceModeHighAccuracy ↔ bool?
-
[Android only]
Enable high-accuracy for geofence-only mode (See BackgroundGeolocation.startGeofences).getter/setter pairinherited - geofenceProximityRadius ↔ int?
-
The radius around current location to query for geofences to activate monitoring upon.
getter/setter pairinherited
- geofenceTemplate ↔ String?
-
Optional custom template for rendering
geofence
JSON request data in HTTP requests.getter/setter pairinherited - hashCode → int
-
The hash code for this object.
no setterinherited
-
headers
↔ Map<
String, dynamic> ? -
Optional HTTP headers applied to each HTTP request.
getter/setter pairinherited
- heartbeatInterval ↔ int?
-
Controls the rate (in seconds) the BackgroundGeolocation.onHeartbeat event will fire.
getter/setter pairinherited
- httpRootProperty ↔ String?
-
The root property of the JSON schema where location-data will be attached.
getter/setter pairinherited
- httpTimeout ↔ int?
-
HTTP request timeout in milliseconds.
getter/setter pairinherited
- isFirstBoot ↔ bool
-
Indicates if this is the first launch of the app after initial install
getter/setter pair
- isMoving ↔ bool?
-
Configure the initial tracking-state after BackgroundGeolocation.start is called.
getter/setter pairinherited
-
locationAuthorizationAlert
↔ Map<
String, dynamic> ? -
[iOS only]
Controls the text-elements of the plugin's location-authorization dialog.getter/setter pairinherited - locationAuthorizationRequest ↔ String?
-
Defines the desired location-authorization request you wish for the user to authorize:
getter/setter pairinherited
- locationsOrderDirection ↔ String?
-
Controls the order that locations are selected from the database (and uploaded to your server).
getter/setter pairinherited
- locationTemplate ↔ String?
-
Optional custom template for rendering
location
JSON request data in HTTP requests.getter/setter pairinherited - locationTimeout ↔ int?
-
The default timeout in seconds when requesting a location before the SDK gives up and fires a LocationError.
getter/setter pairinherited
- locationUpdateInterval ↔ int?
-
[Android only]
Set the desired interval for active location updates, in milliseconds.getter/setter pairinherited - logLevel ↔ int?
-
Controls the volume of recorded events in the plugin's logging database.
getter/setter pairinherited
- logMaxDays ↔ int?
-
Maximum number of days to persist a log-entry in database.
getter/setter pairinherited
- map ↔ Map
-
getter/setter pair
- maxBatchSize ↔ int?
-
Controls the number of records attached to each batch HTTP request.
getter/setter pairinherited
- maxDaysToPersist ↔ int?
-
Maximum number of days to store a geolocation in plugin's SQLite database.
getter/setter pairinherited
- maxMonitoredGeofences ↔ int?
-
The maximum number of geofences to monitor at-a-time, overriding the platform default (iOS: 20; Android 100).
NOTE: This option is for specialized use-cases where you wish to monitor LESS THAN the platform maximum. This option should generally not be used.
getter/setter pairinherited
- maxRecordsToPersist ↔ int?
-
Maximum number of records to persist in plugin's SQLite database.
getter/setter pairinherited
- method ↔ String?
-
The HTTP method to use when creating an HTTP request to your configured url.
getter/setter pairinherited
- minimumActivityRecognitionConfidence ↔ int?
-
The minimum motion-activity confidence to conclude a device is moving.
getter/setter pairinherited
- motionTriggerDelay ↔ int?
-
[Android only]
Optionally add a delay in milliseconds to trigger Android into the moving state when Motion API reports the device is moving (eg:on_foot
,in_vehicle
)getter/setter pairinherited - notification ↔ Notification?
-
(Android only) Configure the persistent foreground notification.
getter/setter pairinherited
- notificationChannelName ↔ String?
-
@deprecated. Use Notification.channelName
getter/setter pairinherited
- notificationColor ↔ String?
-
@deprecated. Use Notification.color.
getter/setter pairinherited
- notificationLargeIcon ↔ String?
-
@deprecated. Use Notification.largeIcon.
getter/setter pairinherited
- notificationPriority ↔ int?
-
@deprecated. Use Notification.priority.
getter/setter pairinherited
- notificationSmallIcon ↔ String?
-
@deprecated. Use Notification.smallIcon.
getter/setter pairinherited
- notificationText ↔ String?
-
@deprecated. Use Notification.text.
getter/setter pairinherited
- notificationTitle ↔ String?
-
@deprecated. Use Notification.title.
getter/setter pairinherited
- odometer ↔ double
-
Current distance traveled.
getter/setter pair
-
params
↔ Map<
String, dynamic> ? -
Optional HTTP
params
appended to the JSON body of each HTTP request.getter/setter pairinherited - pausesLocationUpdatesAutomatically ↔ bool?
-
[iOS only]
Configure iOS location API to never automatically turn off.getter/setter pairinherited - persistMode ↔ int?
-
Allows you to specify which events to persist to the SDK's internal database: locations | geofences | all (default).
getter/setter pairinherited
- preventSuspend ↔ bool?
-
[iOS only]
Prevent iOS from suspending your application in the background after location-services have been switched off.getter/setter pairinherited - reset ↔ bool?
-
Forces BackgroundGeolocation.ready to apply supplied Config with each application launch.
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
schedule
↔ List<
String> ? -
Configures an automated, cron-like schedule for the plugin to BackgroundGeolocation.start / BackgroundGeolocation.stop tracking at pre-defined times.
getter/setter pairinherited
- schedulerEnabled ↔ bool
-
Whether the plugin's Config.schedule has been activated with BackgroundGeolocation.startSchedule.
getter/setter pair
- scheduleUseAlarmManager ↔ bool?
-
Android only Force the Android scheduler to use
AlarmManager
(more precise) instead ofJobScheduler
. Defaults tofalse
.getter/setter pairinherited - showsBackgroundLocationIndicator ↔ bool?
-
[iOS Only]
A Boolean indicating whether the status bar changes its appearance when an app uses location services in the background.getter/setter pairinherited - speedJumpFilter ↔ int?
-
Experimental filter to ignore anomalous locations that suddenly jump an unusual distance from last.
The SDK will calculate an apparent speed and distance relative to last known location. If the location suddenly
teleports from last location, it will be ignored.
getter/setter pairinherited
- startOnBoot ↔ bool?
-
Controls whether to resume location-tracking after device is rebooted.
getter/setter pairinherited
- stationaryRadius ↔ double?
-
[iOS only]
The minimum distance the device must move beyond the stationary location for aggressive background-tracking to engage.getter/setter pairinherited - stopAfterElapsedMinutes ↔ int?
-
Automatically BackgroundGeolocation.stop tracking after x minutes.
getter/setter pairinherited
- stopDetectionDelay ↔ int?
-
[iOS only]
Allows the iOS stop-detection system to be delayed from activating.getter/setter pairinherited - stopOnStationary ↔ bool?
-
Automatically BackgroundGeolocation.stop when the stopTimeout elapses.
getter/setter pairinherited
- stopOnTerminate ↔ bool?
-
Controls whether to continue location-tracking after application is terminated.
getter/setter pairinherited
- stopTimeout ↔ int?
-
Minutes to wait in moving state with no movement before considering the device stationary.
getter/setter pairinherited
- trackingMode ↔ int
-
Whether the plugin is in the location-tracking mode (BackgroundGeolocation.start or geofences-only mode (BackgroundGeolocation.startGeofences).
getter/setter pair
- transistorAuthorizationToken ↔ TransistorAuthorizationToken?
-
Convenience option to automatically configures the SDK to upload locations to the Transistor Software demo server at http://tracker.transistorsoft.com (or your own local instance of background-geolocation-console)
getter/setter pairinherited
- triggerActivities ↔ String?
-
Configures a comma-separated list of motion-activities which are allow to trigger location-tracking.
⚠️ Warning: Requires that the user grant your app the "Motion/Health" permission.
These are the comma-delimited list of activity-names returned by the
ActivityRecognition
API which will trigger a state-change from stationary to moving. By default, the plugin will trigger on any of the moving-states:getter/setter pairinherited - url ↔ String?
-
Your server
url
where you wish toPOST
locations to.getter/setter pairinherited - useSignificantChangesOnly ↔ bool?
-
Set
true
in order to disable constant background-tracking. Locations will be recorded only periodically.getter/setter pairinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
set(
String key, dynamic value) → Config -
inherited
-
toMap(
) → Map? -
inherited
-
toString(
) → String -
Return String representation of
State
forprint
to log.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited