Pakete, Repositories und App-Kategorien suchen

Cover von location
Paketdetailsv10.2.0

location

Plattformübergreifender Plugin für den einfachen Zugriff auf die Echtzeitstandortdaten des Geräts.

AndroidiOSWebmacOS
30-Tage-Downloads
226.000
Likes
3210
Pub-Punkte
150

Paket installieren

flutter pub add location

Paketübersicht

Aus öffentlichen Paketdaten erstellte Orientierung.

Das location-Paket bietet eine plattformübergreifende Lösung für den Zugriff auf die Echtzeit-Geräteposition unter Android, iOS, Web und macOS. Es vereinfacht Geolocation-Aufgaben mit einer konsistenten API über Plattformen hinweg, wodurch Entwickler die aktuelle Position abrufen, Standortänderungen überwachen und Berechtigungen nahtlos verwalten können. Für einfache Nutzung konzipiert, abstrahiert es plattformspezifische Komplexitäten, während Zuverlässigkeit und Leistung gewährleistet bleiben. Ideal für Apps, die ortsbasierte Dienste wie Karten, Tracking oder Nahbereichsfunktionen erfordern.

Anwendungsfälle

  • Echtzeit-Standortverfolgung
  • Geofencing-Integration
  • Kartenbasierte Anwendungen
  • Abruf der Benutzerposition
  • Standortbewusste Benachrichtigungen
  • Reise- und Navigations-Apps

Hauptmerkmale

  • Plattformübergreifende Kompatibilität
  • Echtzeit-Ortungsaktualisierungen
  • Berechtigungsverwaltung
  • Einfache API-Schnittstelle
  • Unterstützung für alle wichtigen Plattformen
  • Hintergrundortungszugriff

Geeignet für

  • Mobile-App-Entwickler
  • Standortbasierte Dienstleistungs-Apps
  • Verfolgungs- und Kartierungstools
  • Web- und Desktop-Standort-Apps
  • Apps, die eine genaue Gerätepositionierung benötigen

Hinweise

  • Erforderliche Berechtigungskonfiguration
  • Hintergrundstandort kann die Akkulaufzeit beeinträchtigen
  • Web-Unterstützung beschränkt auf Browser-Geolocation
  • iOS erfordert eine Datenschutzbeschreibung in info.plist
  • Android benötigt Standortberechtigungen in der Manifest-Datei
  • Die Genauigkeit hängt von der Gerätehardware ab

Original-README

Originaler README-Schnappschuss aus dem verknüpften Quell-Repository. Aktuelle Inhalte finden Sie im Repository.

📍 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

Feature Android iOS macOS Web Windows Linux
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

Package Description pub.dev
location The plugin you use in your app. pub
location_platform_interface Shared platform interface. pub
location_web Web 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.

Kategorien

Abhängigkeiten

Abhängigkeiten 2 Einträge

  • location_platform_interface^7.0.0
  • location_web^7.0.0

Quell-Repository

Projekte, die dieses Paket verwenden

Ranglisten