GFProgressBar constructor

GFProgressBar({
  1. Key? key,
  2. EdgeInsets? margin = const EdgeInsets.only(left: 10, right: 10),
  3. double percentage = 0.2,
  4. double circleWidth = 5.0,
  5. double circleStartAngle = 0.0,
  6. double? radius,
  7. Color backgroundColor = const Color(0xFFB8C7CB),
  8. Color progressBarColor = Colors.red,
  9. LinearGradient? linearGradient,
  10. bool animation = false,
  11. int animationDuration = 700,
  12. Widget? child,
  13. bool autoLive = true,
  14. bool animateFromLastPercentage = false,
  15. bool reverse = false,
  16. MaskFilter? mask,
  17. GFProgressType type = GFProgressType.linear,
  18. GFProgressHeadType? progressHeadType,
  19. double lineHeight = 5.0,
  20. double? width,
  21. bool fromRightToLeft = false,
  22. Widget? leading,
  23. Widget? trailing,
  24. EdgeInsets? padding,
  25. MainAxisAlignment alignment = MainAxisAlignment.start,
  26. bool clipLinearGradient = false,
  27. bool? isDragable = false,
  28. ValueChanged<double>? onProgressChanged,
})

Shows progress as a completed and remaining percentage in bar of given state

Implementation

GFProgressBar({
  Key? key,
  this.margin = const EdgeInsets.only(left: 10, right: 10),
  this.percentage = 0.2,
  this.circleWidth = 5.0,
  this.circleStartAngle = 0.0,
  this.radius,
  this.backgroundColor = const Color(0xFFB8C7CB),
  this.progressBarColor = Colors.red,
  this.linearGradient,
  this.animation = false,
  this.animationDuration = 700,
  this.child,
  this.autoLive = true,
  this.animateFromLastPercentage = false,
  this.reverse = false,
  this.mask,
  this.type = GFProgressType.linear,
  this.progressHeadType,
  this.lineHeight = 5.0,
  this.width,
  this.fromRightToLeft = false,
  this.leading,
  this.trailing,
  this.padding,
  this.alignment = MainAxisAlignment.start,
  this.clipLinearGradient = false,
  this.isDragable = false,
  this.onProgressChanged,
}) : super(key: key) {
  // if (linearGradient != null) {
  //   throw ArgumentError(' linearGradient cannot be given');
  // }
  if (circleStartAngle < 0.0) {
    throw Exception('circleStartAngle cannot be less than zero');
  }
  if (percentage < 0.0 || percentage > 1.0) {
    throw Exception('Percentage value must be be tween 0.0 and 1.0');
  }
}