LinearPercentIndicator constructor

const LinearPercentIndicator({
  1. Key? key,
  2. double percent = 0.0,
  3. double? width,
  4. double lineHeight = 10.0,
  5. Color progressColor = Colors.blue,
  6. Color backgroundColor = const Color(0xFFE0E0E0),
  7. Gradient? linearGradient,
  8. Gradient? backgroundGradient,
  9. bool animation = false,
  10. int animationDuration = 500,
  11. Curve animationCurve = Curves.easeInOut,
  12. bool restartAnimation = false,
  13. bool animateFromLastPercent = false,
  14. Widget? leading,
  15. Widget? trailing,
  16. Widget? center,
  17. LinearChildPosition childPosition = LinearChildPosition.center,
  18. BorderRadius? borderRadius,
  19. EdgeInsets leadingPadding = const EdgeInsets.only(right: 8),
  20. EdgeInsets trailingPadding = const EdgeInsets.only(left: 8),
  21. bool fillBackground = false,
  22. bool clipLinearGradient = true,
  23. VoidCallback? onAnimationEnd,
  24. List<LinearSegment>? segments,
  25. bool showPercentage = false,
  26. TextStyle? percentageTextStyle,
  27. int percentageDecimals = 0,
  28. bool addPercentSign = true,
  29. MainAxisAlignment alignment = MainAxisAlignment.start,
  30. EdgeInsets padding = EdgeInsets.zero,
  31. MaskFilter? maskFilter,
  32. bool isRTL = false,
  33. 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');