Lyokone/flutterlocation

A Flutter plugin to easily handle realtime location in Android, iOS, macOS, Web, Windows and Linux. Provides settings for optimizing performance or battery.

Dart

1,157

627 commits

updated Aug 7, 2026

See the code

README

๐Ÿ“ 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.

android
dart
flutter
flutter-plugin
gps
ios
linux
location
macos
web
windows

Contributors

(top 30 of 57)

Lyokone

342 commits

bartekpacia

140 commits

mehmetf

26 commits

long1eu

11 commits

Lyokone/flutterlocation

A Flutter plugin to easily handle realtime location in Android, iOS, macOS, Web, Windows and Linux. Provides settings for optimizing performance or battery.

Dart

1,157

627 commits

updated Aug 7, 2026

See the code

README

๐Ÿ“ 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.

android
dart
flutter
flutter-plugin
gps
ios
linux
location
macos
web
windows

Contributors

(top 30 of 57)

Lyokone

342 commits

bartekpacia

140 commits

mehmetf

26 commits

long1eu

11 commits

Languages

Dart

36.6%

Kotlin

25.6%

C++

17.0%

CMake

9.0%

Swift

9.0%

Ruby

1.4%