Skip to content
pubscout

fl_location

5.0.0, released 2 years ago by pravera.me

Plugin to access device location on Android, iOS, and Web

WASM-ready
$ flutter pub add fl_location
Source repository

What it does

Provides APIs to request location permission, get the current location, and subscribe to real‑time location and service status streams. It supports foreground and background location on all three platforms.

AI-written summary of version 5.0.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • When you need to request location permission and get the current location
  • When you need continuous location updates via a stream
  • When you need to monitor location services status changes

Skip it when

  • When you only need a one‑time location without permission handling
  • When you need advanced geofencing or mapping features

Strengths

  • Cross‑platform support (Android, iOS, Web)
  • Real‑time streams for location and service status
  • Background location support with flutter_foreground_task

Weaknesses

  • Requires manual permission configuration
  • No built‑in mapping or geofencing features
  • Limited to basic location data

Setup

Kind
Plugin (native code)
Effort
Medium
Code generation
No
Direct dependencies
2

Add Android permissions (ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION, optional ACCESS_BACKGROUND_LOCATION) to AndroidManifest.xml; add iOS usage descriptions to Info.plist; no build_runner needed.

```dart
import 'package:fl_location/fl_location.dart';

Future<void> getLocation() async {
  if (await FlLocation.isLocationServicesEnabled) {
    final loc = await FlLocation.getLocation();
    print('Lat: ${loc.latitude}, Lng: ${loc.longitude}');
  }
}
```

Alternatives

Packages that do the same job and could replace fl_location.

  • geolocator

    More mature, widely used, and includes additional features like geofencing and distance calculations

Works with

Packages commonly used together with fl_location: ones it builds on, ones built on it, and its own family.