simple_animation_progress_bar

该Flutter小部件包旨在展示响应式动画进度条。它还支持垂直和水平条。

特点

  • 线性进度条
  • 渐变色
  • 设置比例值
  • 设置边框值
  • 设置边框半径值
  • 设置背景颜色
  • 设置前景颜色
  • 设置动画类型
  • 设置延迟值
  • 设置方向
  • 设置反向条

入门

您应该确保将路由作为依赖项添加到您的flutter项目中。

dependencies:
 simple_animation_progress_bar: "^1.1.0"

然后,您应该运行flutter packages upgrade或在IntelliJ中更新您的包。

示例项目

example文件夹中有一个示例项目。查看它。否则,请继续阅读以开始使用。

用法

需要将包导入到将要使用它的dart文件中,请使用以下命令:

import 'package:simple_animation_progress_bar/simple_animation_progress_bar.dart';

使用线性进度条的基本小部件用法

SimpleAnimationProgressBar(
    height: 30,
    width: 300,
    backgroundColor: Colors.grey.shade800,
    foregrondColor: Colors.purple,
    ratio: 0.5,
    direction: Axis.horizontal,
    curve: Curves.fastLinearToSlowEaseIn,
    duration: const Duration(seconds: 3),
    borderRadius: BorderRadius.circular(10),
)

使用渐变小部件的线性进度条

SimpleAnimationProgressBar(
    height: 30,
    width: 300,
    backgroundColor: Colors.grey.shade800,
    foregrondColor: Colors.purple,
    ratio: 0.5,
    direction: Axis.horizontal,
    curve: Curves.fastLinearToSlowEaseIn,
    duration: const Duration(seconds: 3),
    borderRadius: BorderRadius.circular(10),
    gradientColor: const LinearGradient(
    colors: [Colors.pink, Colors.purple]),
)

GitHub

查看 Github