LinearPercentIndicator constructor
const
LinearPercentIndicator({
- Key? key,
- double percent = 0.0,
- double? width,
- double lineHeight = 10.0,
- Color progressColor = Colors.blue,
- Color backgroundColor = const Color(0xFFE0E0E0),
- Gradient? linearGradient,
- Gradient? backgroundGradient,
- bool animation = false,
- int animationDuration = 500,
- Curve animationCurve = Curves.easeInOut,
- bool restartAnimation = false,
- bool animateFromLastPercent = false,
- Widget? leading,
- Widget? trailing,
- Widget? center,
- LinearChildPosition childPosition = LinearChildPosition.center,
- BorderRadius? borderRadius,
- EdgeInsets leadingPadding = const EdgeInsets.only(right: 8),
- EdgeInsets trailingPadding = const EdgeInsets.only(left: 8),
- bool fillBackground = false,
- bool clipLinearGradient = true,
- VoidCallback? onAnimationEnd,
- List<
LinearSegment> ? segments, - bool showPercentage = false,
- TextStyle? percentageTextStyle,
- int percentageDecimals = 0,
- bool addPercentSign = true,
- MainAxisAlignment alignment = MainAxisAlignment.start,
- EdgeInsets padding = EdgeInsets.zero,
- MaskFilter? maskFilter,
- bool isRTL = false,
- Radius? barRadius,
Creates a linear percent indicator widget.
Implementation
// ignore: sort_constructors_first
const LinearPercentIndicator({
super.key,
this.percent = 0.0,
this.width,
this.lineHeight = 10.0,
this.progressColor = Colors.blue,
this.backgroundColor = const Color(0xFFE0E0E0),
this.linearGradient,
this.backgroundGradient,
this.animation = false,
this.animationDuration = 500,
this.animationCurve = Curves.easeInOut,
this.restartAnimation = false,
this.animateFromLastPercent = false,
this.leading,
this.trailing,
this.center,
this.childPosition = LinearChildPosition.center,
this.borderRadius,
this.leadingPadding = const EdgeInsets.only(right: 8),
this.trailingPadding = const EdgeInsets.only(left: 8),
this.fillBackground = false,
this.clipLinearGradient = true,
this.onAnimationEnd,
this.segments,
this.showPercentage = false,
this.percentageTextStyle,
this.percentageDecimals = 0,
this.addPercentSign = true,
this.alignment = MainAxisAlignment.start,
this.padding = EdgeInsets.zero,
this.maskFilter,
this.isRTL = false,
this.barRadius,
}) : assert(percent >= 0.0 && percent <= 1.0,
'Percent must be between 0.0 and 1.0');