GaugeIndicator constructor

const GaugeIndicator({
  1. Key? key,
  2. double value = 0.0,
  3. double size = 200.0,
  4. double strokeWidth = 15.0,
  5. Color valueColor = Colors.blue,
  6. Color backgroundColor = const Color(0xFFE0E0E0),
  7. Gradient? gradient,
  8. double startAngle = 135.0,
  9. double sweepAngle = 270.0,
  10. bool showValue = true,
  11. GaugeLabelPosition labelPosition = GaugeLabelPosition.center,
  12. String valueFormatter(
    1. double value
    )?,
  13. TextStyle? valueTextStyle,
  14. Widget? center,
  15. bool animation = false,
  16. Duration animationDuration = const Duration(milliseconds: 500),
  17. Curve animationCurve = Curves.easeInOut,
  18. GaugeStyle gaugeStyle = GaugeStyle.simple,
  19. int tickCount = 10,
  20. double tickLength = 8.0,
  21. Color? tickColor,
  22. List<GaugeSegment>? segments,
  23. List<GaugeRange>? ranges,
  24. bool showNeedle = false,
  25. Color needleColor = Colors.red,
  26. double needleLength = 0.8,
  27. bool showMinMax = false,
  28. String? minLabel,
  29. String? maxLabel,
  30. TextStyle? minMaxTextStyle,
  31. Widget? title,
  32. Widget? subtitle,
  33. StrokeCap strokeCap = StrokeCap.round,
  34. VoidCallback? onAnimationEnd,
})

Creates a gauge indicator widget.

Implementation

// ignore: sort_constructors_first
const GaugeIndicator({
  super.key,
  this.value = 0.0,
  this.size = 200.0,
  this.strokeWidth = 15.0,
  this.valueColor = Colors.blue,
  this.backgroundColor = const Color(0xFFE0E0E0),
  this.gradient,
  this.startAngle = 135.0,
  this.sweepAngle = 270.0,
  this.showValue = true,
  this.labelPosition = GaugeLabelPosition.center,
  this.valueFormatter,
  this.valueTextStyle,
  this.center,
  this.animation = false,
  this.animationDuration = const Duration(milliseconds: 500),
  this.animationCurve = Curves.easeInOut,
  this.gaugeStyle = GaugeStyle.simple,
  this.tickCount = 10,
  this.tickLength = 8.0,
  this.tickColor,
  this.segments,
  this.ranges,
  this.showNeedle = false,
  this.needleColor = Colors.red,
  this.needleLength = 0.8,
  this.showMinMax = false,
  this.minLabel,
  this.maxLabel,
  this.minMaxTextStyle,
  this.title,
  this.subtitle,
  this.strokeCap = StrokeCap.round,
  this.onAnimationEnd,
}) : assert(
          value >= 0.0 && value <= 1.0, 'Value must be between 0.0 and 1.0');