---
title: Settings
description: How to change your location settings
---

# Settings

Location uses a single set of global settings, applied with `changeSettings`.
These settings are shared by both `getLocation` and `onLocationChanged`.

```dart
Future<bool> changeSettings({
  /// The accuracy of the location request. One of the `LocationAccuracy`
  /// values: powerSave, low, balanced, high, navigation or reduced.
  LocationAccuracy? accuracy = LocationAccuracy.high,

  /// The interval between location updates, in milliseconds.
  /// Not used on web.
  int? interval = 1000,

  /// The smallest distance, in meters, the device has to move before a new
  /// update is emitted. Not used on web.
  double? distanceFilter = 0,

  /// Whether the underlying platform location manager may pause updates to
  /// improve battery life. Only used on iOS and macOS.
  bool? pausesLocationUpdatesAutomatically = true,

  /// An alternate update interval (in milliseconds) used while background mode
  /// is enabled. When set, the interval switches to this value once you call
  /// `enableBackgroundMode(enable: true)` and back to `interval` when background
  /// mode is disabled. Android only; `null` (the default) keeps `interval`.
  int? backgroundInterval,
})
```

When you call `changeSettings`, an active `onLocationChanged` stream is updated with the new settings without being closed. The next `getLocation` call also uses them.

`backgroundInterval` lets you poll less frequently to save battery while the app
is backgrounded, then resume the foreground `interval` automatically. It is
Android-only — Core Location has no equivalent on iOS/macOS.

If you need continuous background tracking on iOS/macOS and see updates stop
unexpectedly after some time (the exact duration varies — it depends on the
device's movement, not a fixed timeout), set
`pausesLocationUpdatesAutomatically: false`. Core Location's default (`true`)
lets it pause updates on its own judgment — e.g. when the device appears to
have stopped moving — as a battery-saving heuristic, which is usually fine but
can be surprising for an app that expects truly continuous updates (like live
tracking).

## Example

```dart
final location = Location();
await location.changeSettings(
    accuracy: LocationAccuracy.high,
    interval: 1000,
    distanceFilter: 0,
);
```
