IntervalProgressBar

Flutter 的区间进度小部件。

依赖它

https://pub.dev/packages/intervalprogressbar

将此添加到您的 package 的 pubspec.yaml 文件中

dependencies:
  intervalprogressbar: ^0.0.2

特点

  • 水平
  • 垂直
  • Interval Progress
  • 多彩

入门

预览示例代码

Center(
   child: Row(
       mainAxisAlignment: MainAxisAlignment.center,
       children: [10, 29, 18, 27, 16, 15, 24, 3, 20, 10]
           .map<Widget>((i) {
         return Padding(
             padding: EdgeInsets.only(right: 10),
             child: IntervalProgressBar(
                 direction: IntervalProgressDirection.vertical,
                 max: 30,
                 progress: i,
                 intervalSize: 2,
                 size: Size(12, 200),
                 highlightColor: Colors.red,
                 defaultColor: Colors.grey,
                 intervalColor: Colors.transparent,
                 intervalHighlightColor: Colors.transparent,
                 reverse: true,
                 radius: 0));
       }).toList()),
)

属性

属性 类型 注意
direction enum ProgressBar的方向,支持verticalhorizontal
max 整数 默认块的数量
progress 整数 高亮块的数量
intervalSize 整数 间隔块的大小。当方向为vertical时,表示高度;当方向为horizontal时,表示宽度
size Size 此组件的大小
highlightColor 颜色 高亮块的颜色
defaultColor 颜色 默认块的颜色
intervalColor 颜色 默认间隔的颜色
intervalHighlightColor 颜色 高亮块之间间隔的颜色
reverse 布尔值
radius 整数

GitHub

https://github.com/stefanJi/IntervalProgressBar