README.md

July 23, 2026 Β· View on GitHub

πŸ“ Flutter Location

The easiest way to get a device's location in real-time β€” on every platform Flutter runs.

One simple API for GPS coordinates, live location streams and background tracking on Android, iOS, macOS, Web, Windows and Linux.

pub version pub likes pub points codecov license

πŸ“– Documentation Β Β·Β  🌐 Live web demo Β Β·Β  πŸ“¦ pub.dev Β Β·Β  πŸ’¬ Feedback


✨ Why Location?

  • 🌍 Truly cross-platform β€” the same code runs on all six Flutter targets, no per-platform branching.
  • ⚑ One-line to a fix β€” await location.getLocation() and you're done.
  • πŸ”΄ Real-time streams β€” subscribe to onLocationChanged for continuous updates.
  • πŸŒ™ Background tracking β€” keep receiving locations while your app is backgrounded on Android & iOS.
  • πŸŽ›οΈ Tunable β€” pick accuracy, update interval and distance filter to balance precision vs. battery.
  • πŸ”” Customizable notification β€” full control over the Android foreground-service notification.
  • πŸ“Š Rich data β€” latitude, longitude, altitude, speed, heading, accuracy, mock detection and more.
  • πŸ›‘οΈ Battle-tested β€” one of the most-used location plugins in the Flutter ecosystem, maintained since 2017.

πŸ“± Platform support

FeatureAndroidiOSmacOSWebWindowsLinux
One-time locationβœ…βœ…βœ…βœ…βœ…βœ…
Location streamβœ…βœ…βœ…βœ…βœ…βœ…
Background updatesβœ…βœ…β€”β€”β€”β€”
Permission handlingβœ…βœ…βœ…βœ…βœ…βœ…

Windows uses Windows.Devices.Geolocation; Linux talks to GeoClue2 over D-Bus. Both require the system location service to be enabled.

Watch the demo on YouTube

πŸš€ Quick start

Add the package:

dependencies:
  location: ^10.0.0

Get a location:

import 'package:location/location.dart';

final location = Location();

// Make sure the service is on and permission is granted.
if (!await location.serviceEnabled() && !await location.requestService()) return;
if (await location.requestPermission() != PermissionStatus.granted) return;

// One-time fix…
final current = await location.getLocation();
print('${current.latitude}, ${current.longitude}');

// …or a live stream.
location.onLocationChanged.listen((loc) {
  print('Moved to ${loc.latitude}, ${loc.longitude}');
});

That's it. Platform setup (permissions, background mode, sandbox entitlements) and the full API are covered in the package README and the documentation website.

πŸ“¦ Packages in this repository

PackageDescriptionpub.dev
locationThe plugin you use in your app.pub
location_platform_interfaceShared platform interface.pub
location_webWeb implementation.pub

🀝 Contributing

Issues and pull requests are very welcome β€” this plugin is community-maintained and we're always looking for help. Browse the open issues to get started, or open a new one to report a bug or request a feature.

πŸ‘₯ Maintainers

πŸ“„ License

Released under the MIT License. Β© 2017 Guillaume Bernos.