搜索分类、插件与代码仓

activity_ring 封面
插件详情v0.3.0

activity_ring

用于创建苹果手表风格环形进度条的 Flutter 库。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
1810
喜欢数
31
Pub 分数
140

安装插件

flutter pub add activity_ring

插件介绍

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

一个 Flutter 库,可帮助开发者创建类似 Apple Watch 的圆形进度环。这些视觉效果出色的动画环以紧凑且直观的方式显示进度,非常适合追踪目标、时间或完成百分比。该包支持 Android、iOS、Web、macOS、Windows 和 Linux 多个平台,确保在不同设备上保持一致的用户界面。提供可自定义的颜色、线条宽度和动画效果,以匹配应用主题。非常适合健身应用、仪表板或任何需要优雅进度可视化功能的应用。

适合场景

  • 健身追踪应用
  • 仪表板小部件
  • 目标完成指示器
  • 基于时间的进度显示
  • 交互式 UI 元素

主要特点

  • Apple Watch 风格的圆形进度环
  • 可自定义的颜色和笔画宽度
  • 平滑动画
  • 跨平台支持
  • 简单 API 集成
  • 响应式设计

适合对象

  • 开发健身或健康类应用的开发者
  • 寻求现代 UI 组件的设计人员
  • 需要视觉进度反馈的应用程序
  • 跨平台应用
  • 目标导向界面的项目

使用建议

  • 需要理解 Flutter 的绘图和动画系统
  • 可能需要在低端设备上进行性能调优
  • 仅限圆形进度可视化
  • 不适合复杂的数据可视化

原始 README

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

Activity Rings

pub package

Library to create Progress bars in Apple Watch style rings - Apple Watch Rings

To use, import package:activity_ring/activity_ring.dart.

This library is built with to be extremely customizable with low effort. Please check the API documentation if you get stuck anywhere.

Note: Do not let the auto brighten colors to exceed 3 rings as this will cause a runtime exception.

Example

There are several ways to create rings.

Using a single color
Ring(
  percent: 90,
  color: RingColorScheme(ringColor: Colors.red),
  radius: 80,
  width: 10,
  child: Center(child: Text('90%')),
)

RingColor

The above ring is automatically painted with gradients. To have a constant color just pass gradient: false to RingColorScheme.

Using a single gradient
Ring(
  percent: 90,
  color: RingColorScheme(ringGradient: [Colors.red, Colors.blue]),
  radius: 80,
  width: 10,
  child: Center(child: Text('90%')),
),

RingGradient

The above ring is automatically painted with gradient from colors given.

Using same color for a ring with different color for each ring
Ring(
  percent: 190,
  color: RingColorScheme(ringColors: [Colors.red, Colors.blue]),
  radius: 80,
  width: 10,
  child: Center(child: Text('190%')),
),

RingColors

The above ring is automatically painted with gradient from colors given, where each color in list represents that ring's color. To have a constant color just pass gradient: false to RingColorScheme.

Explicitly mentioning gradinet for each ring
Ring(
  percent: 190,
  color: RingColorScheme(ringGradients: [[Colors.red, Colors.yellow], [Colors.yellow, Colors.green]]),
  radius: 80,
  width: 10,
  child: Center(child: Text('190%')),
),

RingGradients

The above ring is automatically painted with gradient from colors given, where each color in list represents that ring's color. To have a constant color just pass gradient: false to RingColorScheme.

TODO

  • [ ] Create templates for apple colors
  • [ ] Add tests and coverage

所属分类

源码仓库

使用此插件的项目

暂无相关数据。