LinearProgressBar constructor
LinearProgressBar({
- Key? key,
- Color fillColor = Colors.transparent,
- double percent = 0.0,
- double lineHeight = 5.0,
- double? width,
- Color? backgroundColor,
- LinearGradient? linearGradientBackgroundColor,
- LinearGradient? linearGradient,
- Color? progressColor,
- bool animation = false,
- int animationDuration = 500,
- bool animateFromLastPercent = false,
- bool isRTL = false,
- Widget? leading,
- Widget? trailing,
- Widget? center,
- bool addAutomaticKeepAlive = true,
- Radius? barRadius,
- EdgeInsets padding = const EdgeInsets.symmetric(horizontal: 10.0),
- MainAxisAlignment alignment = MainAxisAlignment.start,
- MaskFilter? maskFilter,
- bool clipLinearGradient = false,
- Curve curve = Curves.linear,
- bool restartAnimation = false,
- VoidCallback? onAnimationEnd,
- Widget? widgetIndicator,
- Color? progressBorderColor,
Implementation
LinearProgressBar({
Key? key,
this.fillColor = Colors.transparent,
this.percent = 0.0,
this.lineHeight = 5.0,
this.width,
Color? backgroundColor,
this.linearGradientBackgroundColor,
this.linearGradient,
Color? progressColor,
this.animation = false,
this.animationDuration = 500,
this.animateFromLastPercent = false,
this.isRTL = false,
this.leading,
this.trailing,
this.center,
this.addAutomaticKeepAlive = true,
this.barRadius,
this.padding = const EdgeInsets.symmetric(horizontal: 10.0),
this.alignment = MainAxisAlignment.start,
this.maskFilter,
this.clipLinearGradient = false,
this.curve = Curves.linear,
this.restartAnimation = false,
this.onAnimationEnd,
this.widgetIndicator,
this.progressBorderColor,
}) : assert(percent >= 0.0 && percent <= 1.0, 'percent must be between 0.0 and 1.0'),
assert(lineHeight > 0, 'lineHeight must be greater than 0'),
assert(animationDuration > 0, 'animationDuration must be greater than 0'),
assert(linearGradient == null || progressColor == null,
'Cannot set both linearGradient and progressColor'),
assert(linearGradientBackgroundColor == null || backgroundColor == null,
'Cannot set both linearGradientBackgroundColor and backgroundColor'),
super(key: key) {
_progressColor = progressColor ?? Colors.red;
_backgroundColor = backgroundColor ?? const Color(0xFFB8C7CB);
}