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

插件详情v0.8.1

flutter_compass

一个 Flutter 指南针。航向范围为 0-360,0 表示正北。

AndroidiOS
近 30 天下载
10.6万
喜欢数
191
Pub 分数
150

安装插件

flutter pub add flutter_compass

插件介绍

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

一个 Flutter 包,提供对设备指南针传感器的访问,可实时获取 0 到 360 度的方向值,其中 0 表示正北。它使应用程序能够利用设备内置的磁力计检测方向方位。该包兼容 Android 和 iOS 平台,并可无缝集成到 Flutter 应用中。开发者可以使用它来构建导航工具、增强现实功能或任何需要方向感知的应用。

适合场景

  • 导航应用
  • 增强现实体验
  • 方向性用户界面指示器
  • 户外活动追踪
  • 基于地图的应用程序

主要特点

  • 实时航向更新
  • 0-360度方向
  • 跨平台支持(Android 和 iOS)
  • 简单 API 集成
  • 基于磁力计的传感

适合对象

  • 开发位置感知应用程序的开发者
  • 需要实时方向数据的应用程序
  • 地理教育工具
  • 徒步和户外导航应用

使用建议

  • 需要配备磁力计的设备
  • 在某些环境中可能需要校准
  • 准确性可能受到磁干扰的影响
  • 没有传感器的设备功能受限

原始 README

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

flutter_compass

pub package

A Flutter compass. The heading varies from 0-360, 0 being north.

Note: Android Only: null is returned as direction on android when no sensor available.

Usage

To use this plugin, add flutter_compass as a dependency in your pubspec.yaml file. For example:

dependencies:
  flutter_compass: '^0.8.1'
iOS

Make sure to add keys with appropriate descriptions to the Info.plist file.

  • NSLocationWhenInUseUsageDescription
  • NSLocationAlwaysAndWhenInUseUsageDescription

:memo: Reference example code

Android

Make sure to add permissions to the app/src/main/AndroidManifest.xml file.

  • android.permission.INTERNET
  • android.permission.ACCESS_COARSE_LOCATION
  • android.permission.ACCESS_FINE_LOCATION

:memo: Reference example code

Recommended support plugins

:memo: Reference example code

所属分类

源码仓库

使用此插件的项目