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

smooth_compass 封面
插件详情v2.0.17

smooth_compass

带有动画旋转的平滑指南针,支持自定义小部件(适用于 Android 和 iOS)

AndroidiOS
近 30 天下载
64
喜欢数
65
Pub 分数
140

安装插件

flutter pub add smooth_compass

插件介绍

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

Smooth Compass 是一个 Flutter 包,提供带有动画效果的平滑指南针界面,支持 Android 和 iOS。它利用设备传感器检测方向,并提供流畅的旋转动画,以实现精致的用户体验。开发者可以使用自定义小部件来自定义指南针外观,从而将其集成到各种 UI 设计中。该包轻量且易于实现,非常适合导航应用、户外工具或任何需要实时方向反馈的应用。

适合场景

  • 导航应用
  • 户外活动追踪
  • 增强现实界面
  • 游戏中的方向指引
  • 基于地图的应用程序

主要特点

  • 动画指南针旋转
  • 自定义小部件支持
  • 跨平台兼容性(Android 和 iOS)
  • 实时传感器集成
  • 流畅的视觉过渡

适合对象

  • 开发导航功能的开发者
  • 需要实时方向感应的应用
  • 面向用户界面的指南针实现
  • 跨平台移动应用

使用建议

  • 需要设备陀螺仪和磁力计
  • 可能需要处理传感器的权限
  • 性能取决于设备硬件
  • 仅限指南针功能

原始 README

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

Smooth Compass

Customizable flutter package to find direction using device motion sensors.

Image Image
SmoothCompass with default Widget SmoothCompass with custom Widget

Features

  • Extensive, yet easy to use
  • Preconfigured UI with customizable styling
  • Custom builder
  • Locale support
  • Smooth Rotation
  • Values in degrees

Usage

Make sure to check out examples

Installation

Add the following line to pubspec.yaml:

dependencies:
  smooth_compass: ^1.0.2
Basic setup

The complete example is available here.

SmoothCompass requires you to provide compassBuilder which returns:

  • degrees is the directional value.
  • turns is the value for compass rotation.
  • compassAsset the (default) widget for compass.

SmoothCompass Optional Arguments Height, Width, Duration and compassAsset:

  • compassAsset is the customizable widget for compass. if not provider default will shown.

Default Widget:

SmoothCompass(
 rotationSpeed: 200,
 height: 300,
 width: 300,
// compassAsset:CustomWidget(),   you custom compass widget here
 compassBuilder: (context,AsyncSnapshot<CompassModel>? compassData,Widget compassAsset){
   return compassAsset;
    },
  ),

Custom Widget:

SmoothCompass(
 rotationSpeed: 200,
 height: 300,
 width: 300,
  compassAsset:Container(
  height:200,
  width:200,
    decoration:BoxDecoration(
    shape:BoxShape.circle,
    image:DecorationImage(
    image:AssetImage("path for compass image"),
    fit:BoxFit.cover
   )
  ),
),
 compassBuilder: (context,AsyncSnapshot<CompassModel>? compassData,Widget compassAsset){
   return compassAsset;
    },
  ),
Support

for any queries or issue contact at:

  • alihadi5125@gmail.com
  • fadiktk000@gmail.com

所属分类

依赖

依赖清单 3 项

源码仓库

使用此插件的项目

暂无相关数据。