RectangleAnimatedProgressBar constructor

RectangleAnimatedProgressBar({
  1. Key? key,
  2. double width = 150.0,
  3. double height = 60.0,
  4. double progress = .2,
  5. bool isShowProgress = true,
  6. Curve curve = Curves.linear,
  7. void onPressed()?,
  8. double waveHeight = 12,
  9. Color backgroundColor = const Color(0x262192F3),
  10. double circular = 5.0,
  11. String completedText = 'Completed',
  12. PositionEnum enumPosition = PositionEnum.bottom,
  13. bool completedIsShowWave = true,
  14. List<Color> colorsWave = const [Color(0x4D2196f3), Color(0x662196f3), Color(0xCC2196f3)],
  15. TextStyle showProgressTextStyle = const TextStyle(fontSize: 16, fontWeight: FontWeight.bold, color: Colors.white, shadows: [Shadow(offset: Offset(1, 1), blurRadius: .2, color: Colors.black26)]),
})

构造方法

Implementation

RectangleAnimatedProgressBar(
    {super.key,
    this.width = 150.0,
    this.height = 60.0,
    this.progress = .2,
    this.isShowProgress = true,
    this.curve = Curves.linear,
    this.onPressed,
    this.waveHeight = 12,
    this.backgroundColor = const Color(0x262192F3),
    this.circular = 5.0,
    this.completedText = 'Completed',
    this.enumPosition = PositionEnum.bottom,
    this.completedIsShowWave = true,

    /// 波浪颜色&波浪层数
    /// 默认为蓝色
    /// 2、4、6 排序显示为 最上层为 6 、4 、2
    this.colorsWave = const [
      Color(0x4D2196f3),
      Color(0x662196f3),
      Color(0xCC2196f3),
    ],
    this.showProgressTextStyle = const TextStyle(
        fontSize: 16,
        fontWeight: FontWeight.bold,
        color: Colors.white,
        shadows: [
          Shadow(offset: Offset(1, 1), blurRadius: .2, color: Colors.black26)
        ])})
    : assert(progress >= 0.0 && progress <= 1.0,
          "Progress must be less than 1 and greater than 0"),
      assert(width > 0.0, "The width must be greater than 0"),
      assert(height > 0.0, "The height must be greater than 0"),
      assert(colorsWave.isNotEmpty && colorsWave.length <= 3,
          "ColorsWave must be not empty and length less than 3");