패키지, 저장소 및 앱 카테고리 검색

location 표지
패키지 상세v10.2.0

location

실시간으로 장치 위치에 쉽게 액세스할 수 있는 크로스 플랫폼 플러그인입니다.

AndroidiOSWebmacOS
30일 다운로드
22.6만
좋아요
3.2천
Pub 점수
150

패키지 설치

flutter pub add location

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

location 패키지는 안드로이드, iOS, 웹 및 맥OS에서 실시간 장치 위치에 접근하기 위한 크로스플랫폼 솔루션을 제공합니다. 일관된 API를 통해 플랫폼 간에 지오로케이션 작업을 단순화하여 현재 위치를 가져오고, 위치 변경을 모니터링하며 권한을 원활하게 처리할 수 있도록 합니다. 사용의 용이성을 위해 설계되었으며, 플랫폼별 복잡성을 추상화하면서도 신뢰성과 성능을 유지합니다. 지도, 추적, 근접 기능 등 위치 기반 서비스가 필요한 앱에 적합합니다.

사용 사례

  • 실시간 위치 추적
  • 지오페싱 통합
  • 지도 기반 애플리케이션
  • 사용자 위치 검색
  • 위치 인식 알림
  • 여행 및 내비게이션 앱

주요 기능

  • 크로스 플랫폼 호환성
  • 실시간 위치 업데이트
  • 권한 처리
  • 간단한 API 인터페이스
  • 모든 주요 플랫폼 지원
  • 백그라운드 위치 액세스

적합한 대상

  • 모바일 앱 개발자
  • 위치 기반 서비스 앱
  • 추적 및 매핑 도구
  • 웹 및 데스크톱 위치 앱
  • 정확한 장치 위치 정보가 필요한 앱

고려 사항

  • 적절한 권한 구성이 필요합니다
  • 백그라운드 위치 정보는 배터리 수명에 영향을 줄 수 있습니다
  • 웹 지원은 브라우저 위치 정보에 국한됩니다
  • iOS는 info.plist에 개인정보 설명이 필요합니다
  • Android는 매니페스트에서 위치 권한이 필요합니다
  • 정확도는 장치 하드웨어에 따라 달라집니다

원본 README

연결된 소스 저장소의 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

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.

카테고리

의존성

의존성 목록 2 개

  • location_platform_interface^7.0.0
  • location_web^7.0.0

소스 저장소

이 패키지를 사용하는 프로젝트

순위