搜索插件、代码仓与 APP 分类

插件详情v14.1.2

geolocator

Flutter 的地理定位插件。此插件为通用位置(GPS 等)功能提供跨平台(iOS、Android)API。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
300万
喜欢数
6140
Pub 分数
160

安装插件

flutter pub add geolocator

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

geolocator 包是一个跨平台的 Flutter 插件,为 Android、iOS、Web、macOS、Windows 和 Linux 上的设备位置服务提供统一的 API。它使开发者能够以一致的行为获取当前位置、监控位置变化以及检查位置权限。该插件由 Baseflow 开发,可简化在 Flutter 应用中集成 GPS 及其他基于位置的功能。

适合场景

  • 获取用户的当前位置
  • 监控实时位置更新
  • 检查位置权限
  • 构建位置感知的应用程序
  • 与地图和导航集成

主要特点

  • 跨平台兼容性
  • 实时位置跟踪
  • 权限处理
  • 高精度模式支持
  • 后台位置更新

适合对象

  • 移动和桌面位置应用
  • 配送和拼车应用
  • 健身和户外追踪应用
  • 基于位置的通知
  • 地图集成应用

使用建议

  • 需要正确的权限配置
  • 后台位置信息可能影响电池续航
  • 准确性取决于设备硬件
  • Web 支持仅限浏览器地理位置
  • iOS 要求在 Info.plist 中包含使用说明

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Flutter geolocator plugin

The Flutter geolocator plugin is built following the federated plugin architecture. A detailed explanation of the federated plugin concept can be found in the Flutter documentation. This means the geolocator plugin is separated into the following packages:

  1. geolocator: the app facing package. This is the package users depend on to use the plugin in their project. For details on how to use the geolocator plugin you can refer to its README.md file.
  2. geolocator_android: this package contains the endorsed Android implementation of the geolocator_platform_interface and adds Android support to the geolocator app facing package. More information can be found in its README.md file;
  3. geolocator_apple: this package contains the endorsed iOS and macOS implementations of the geolocator_platform_interface and adds iOS and macOS support to the geolocator app facing package. More information can be found in its README.md file;
  4. geolocator_web: this package contains the endorsed web implementation of the geolocator_platform_interface and adds web support to the geolocator app facing package. More information can be found in its README.md file;
  5. geolocator_windows: this package contains the endorsed Windows implementation of the geolocator_platform_interface and adds Windows support to the geolocator app facing package. More information can be found in its README.md file;
  6. geolocator_platform_interface: this package declares the interface which all platform packages must implement to support the app-facing package. Instructions on how to implement a platform package can be found in the README.md of the geolocator_platform_interface package.

所属分类

依赖

依赖清单 6 项

  • geolocator_android^5.1.0
  • geolocator_apple^2.3.14
  • geolocator_linux^0.2.6
  • geolocator_platform_interface^4.4.0
  • geolocator_web^4.1.4
  • geolocator_windows^0.2.3

源码仓库

使用此插件的项目

所在榜单