SignificantChangeConfig class

Configuration for significant location change monitoring.

This mode uses the OS's most battery-efficient location monitoring:

  • iOS: startMonitoringSignificantLocationChanges() - uses cell/WiFi
  • Android: Emulated with large radius geofence auto-follow

Example:

await Locus.startSignificantChangeMonitoring(
  SignificantChangeConfig(
    minDisplacementMeters: 500,
    deferUntilMoved: true,
    onSignificantChange: (location) {
      print('Significant move: ${location.coords.latitude}');
    },
  ),
);

Constructors

SignificantChangeConfig({double minDisplacementMeters = 500, bool deferUntilMoved = true, void onSignificantChange(Location location)?, bool wakeFromBackground = true, bool monitorInForeground = false, Duration? maxUpdateInterval})
Creates a significant change configuration.
const
SignificantChangeConfig.fromMap(JsonMap map)
Creates from a map.
factory

Properties

deferUntilMoved bool
Whether to defer updates until the device has actually moved.
final
hashCode int
The hash code for this object.
no setterinherited
maxUpdateInterval Duration?
Maximum interval between updates regardless of movement.
final
minDisplacementMeters double
Minimum displacement in meters to trigger an update.
final
monitorInForeground bool
Whether to also monitor when app is in foreground.
final
onSignificantChange → void Function(Location location)?
Callback when a significant location change is detected.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
wakeFromBackground bool
Whether to wake the app from background/terminated state.
final

Methods

copyWith({double? minDisplacementMeters, bool? deferUntilMoved, void onSignificantChange(Location)?, bool? wakeFromBackground, bool? monitorInForeground, Duration? maxUpdateInterval}) SignificantChangeConfig
Creates a copy with the given fields replaced.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() JsonMap
Converts to a JSON-serializable map.
toString() String
A string representation of this object.
inherited

Operators

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

Constants

defaults → const SignificantChangeConfig
Default configuration matching iOS behavior.
sensitive → const SignificantChangeConfig
More sensitive - shorter distance threshold.
ultraLowPower → const SignificantChangeConfig
Maximum battery savings - larger threshold.