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

插件详情v1.0.0

flutter_use_geolocation

适用于 Flutter 应用的地理位置钩子。提供 useGeolocation 钩子,用于 GPS 跟踪、位置更新以及带权限处理的位置感知功能。

AndroidiOSWebmacOSWindows
近 30 天下载
47
喜欢数
0
Pub 分数
150

安装插件

flutter pub add flutter_use_geolocation

插件介绍

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

一个 Flutter 包,为构建位置感知应用提供地理定位钩子。它提供了一个 useGeolocation 钩子,可简化 GPS 跟踪、实时位置更新以及跨平台的位置权限处理。专为使用 Flutter Use 生态系统的开发者设计,将复杂的原生交互抽象为简单、响应式的 Dart API。该包支持 Android、iOS、Web、macOS 和 Windows,可在跨平台应用中实现一致的地理定位功能。

适合场景

  • 实时位置跟踪
  • 基于位置的用户界面
  • 权限管理的GPS访问
  • 跨平台地理位置功能
  • 后台位置监控

主要特点

  • 响应式地理位置状态
  • 内置权限处理
  • 跨平台兼容性
  • 基于钩子的简单 API
  • 实时位置更新

适合对象

  • 使用 Flutter 的开发者
  • 需要位置服务的应用
  • 跨平台移动和桌面应用
  • 实时位置功能
  • 基于位置的 UI 反应式更新

使用建议

  • 需要正确的应用权限
  • 可能影响电池续航
  • Web 支持取决于浏览器功能
  • macOS 和 Windows 需要额外的设置
  • 精度取决于设备硬件

原始 README

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

flutter_use

flutter_lints
Inspired by react-use.


A collection of Flutter Hooks inspired by React's react-use library. This monorepo contains multiple packages providing different categories of hooks for Flutter development.

📦 Packages

Package Description Version
flutter_use Core hooks library with essential utilities pub package
flutter_use_audio Audio playback and control hooks pub package
flutter_use_battery Battery state monitoring hooks pub package
flutter_use_geolocation Location and permission hooks pub package
flutter_use_network_state Network connectivity hooks pub package
flutter_use_sensors Device sensors hooks pub package
flutter_use_video Video playbook hooks pub package

🚀 Installation

For the core package:

flutter pub add flutter_use

For specialized packages:

flutter pub add flutter_use_audio    # Audio hooks
flutter pub add flutter_use_battery  # Battery hooks
# ... and so on

🌐 Interactive Demo Site

Try out all hooks with live examples at: https://wasabeef.github.io/flutter_use/

📚 Hooks by Category

📱 Mobile-first Hooks

Core package: flutter_use

  • useAsync — manages async operations with loading, data, and error states.
  • useDebounceFn — debounces function calls for better performance.
  • useInfiniteScroll — implements infinite scrolling with automatic loading.
  • useForm — comprehensive form state management with validation.
  • useKeyboard — tracks keyboard visibility and manages layouts (mobile only).
🎭 State Management

Core package: flutter_use

⏱️ Timing & Animation

Core package: flutter_use

🔄 Side Effects & Performance

Core package: flutter_use

🎯 UI Interactions

Core package: flutter_use

♻️ Lifecycle Management

Core package: flutter_use

🎨 Development & Debugging

Core package: flutter_use

  • useLogger — logs in console as component goes through life-cycles.
📱 Device Sensors

Package: flutter_use_sensors

Core package: flutter_use

🔋 Device Information

Package: flutter_use_battery

Package: flutter_use_geolocation

  • useGeolocation — tracks geo location and permission state of user's device. geolocator

Package: flutter_use_network_state

🎵 Media

Package: flutter_use_audio

  • useAudio — plays audio and exposes its controls. just_audio

Package: flutter_use_video

🚧 Coming Soon

  • useEvent — subscribe to events.
  • useFullscreen — display an element or video full-screen.
  • usePageLeave — triggers when mouse leaves page boundaries.
  • usePermission — query permission status for apps APIs.
  • useMethods — neat alternative to useReducer.
  • useSetState — creates setState method which works like this.setState.
  • usePromise — resolves promise only while component is mounted.
  • useObservable — tracks latest value of an Observable.



Unlicense — public domain.



所属分类

依赖

依赖清单 2 项

源码仓库

使用此插件的项目

暂无相关数据。