パッケージ、リポジトリ、アプリカテゴリを検索

location のカバー
パッケージ詳細v10.2.0

location

リアルタイムでデバイスの位置に簡単にアクセスできるクロスプラットフォーム用プラグイン。

AndroidiOSWebmacOS
30日間ダウンロード
22.6万
いいね数
3210
Pub ポイント
150

パッケージをインストール

flutter pub add location

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

location パッケージは、Android、iOS、Web、macOS におけるリアルタイムのデバイス位置へのアクセスをクロスプラットフォームで提供します。一貫した API を使用して、位置情報の取得、位置変更の監視、権限の処理を簡単に実現できます。使いやすさを重視しており、プラットフォーム固有の複雑さを抽象化しながらも、信頼性とパフォーマンスを維持しています。マップ、トラッキング、近接機能など、位置情報を活用するアプリに最適です。

用途

  • リアルタイムでの位置追跡
  • ジオフェンシング統合
  • 地図ベースのアプリケーション
  • ユーザーの位置取得
  • 場所に応じた通知
  • 旅行およびナビゲーションアプリ

主な機能

  • クロスプラットフォーム互換性
  • リアルタイムの位置情報の更新
  • 権限の処理
  • シンプルなAPIインターフェース
  • すべての主要プラットフォームに対応
  • バックグラウンド位置アクセス

適している対象

  • モバイルアプリ開発者
  • 位置ベースのサービスアプリ
  • トラッキングおよびマッピングツール
  • ウェブおよびデスクトップの場所アプリ
  • 正確なデバイスの位置情報が必要なアプリ

注意事項

  • 適切な権限設定が必要です
  • バックグラウンドでの位置情報はバッテリー寿命に影響する可能性があります
  • Webサポートはブラウザの位置情報に限定されています
  • 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

ソースリポジトリ

このパッケージを使用しているプロジェクト

ランキング