CircularAnimatedProgressBar constructor

CircularAnimatedProgressBar({
  1. Key? key,
  2. double size = 150.0,
  3. double progress = .2,
  4. bool isShowProgress = true,
  5. Curve curve = Curves.linear,
  6. void onPressed()?,
  7. double waveHeight = 12,
  8. bool completedIsShowWave = true,
  9. String completedText = 'Completed',
  10. Color backgroundColor = const Color(0x0D2192F3),
  11. List<Color> colorsWave = const [Color(0x4D2196f3), Color(0x662196f3), Color(0xCC2196f3)],
  12. TextStyle showProgressTextStyle = const TextStyle(fontSize: 20, fontWeight: FontWeight.bold, color: Colors.white, shadows: [Shadow(offset: Offset(1, 1), blurRadius: .2, color: Colors.black26)]),
})

构造方法

Implementation

CircularAnimatedProgressBar(
    {super.key,
    this.size = 150.0,
    this.progress = .2,
    this.isShowProgress = true,
    this.curve = Curves.linear,
    this.onPressed,
    this.waveHeight = 12,
    this.completedIsShowWave = true,
    this.completedText = 'Completed',
    this.backgroundColor = const Color(0x0D2192F3),

    /// 默认为蓝色
    /// 2、4、6 排序显示为 最上层为 6 、4 、2
    this.colorsWave = const [
      Color(0x4D2196f3),
      Color(0x662196f3),
      Color(0xCC2196f3),
    ],
    this.showProgressTextStyle = const TextStyle(
        fontSize: 20,
        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(size > 0.0, "The size must be greater than 0"),
      assert(colorsWave.isNotEmpty && colorsWave.length <= 3,
          "ColorsWave must be not empty and length less than 3");