RectangleAnimatedProgressBar constructor
RectangleAnimatedProgressBar({
- Key? key,
- double width = 150.0,
- double height = 60.0,
- double progress = .2,
- bool isShowProgress = true,
- Curve curve = Curves.linear,
- void onPressed()?,
- double waveHeight = 12,
- Color backgroundColor = const Color(0x262192F3),
- double circular = 5.0,
- String completedText = 'Completed',
- PositionEnum enumPosition = PositionEnum.bottom,
- bool completedIsShowWave = true,
- List<
Color> colorsWave = const [Color(0x4D2196f3), Color(0x662196f3), Color(0xCC2196f3)], - 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");