---
title: Services
description: Check service status
---

# Services

The location service is the system-level switch that has to be on for any app to
access the device's location.

Check whether it is currently enabled:

```dart
Future<bool> serviceEnabled()
```

Request the user to enable it:

```dart
Future<bool> requestService()
```

`getLocation` and `onLocationChanged` also try to activate the service
automatically, so calling these manually is only needed if you want to check or
prompt for the service before requesting a location.

## Examples

### Ensuring the service is enabled

```dart
final location = Location();
var enabled = await location.serviceEnabled();
if (!enabled) {
    enabled = await location.requestService();
    if (!enabled) {
        // The user did not enable the location service.
        return;
    }
}
```
