LinearGauge constructor

const LinearGauge({
  1. Key? key,
  2. double value = 0.0,
  3. LinearGaugeOrientation orientation = LinearGaugeOrientation.horizontal,
  4. double? length,
  5. double thickness = 20.0,
  6. Color backgroundColor = const Color(0xFFE0E0E0),
  7. Color valueColor = Colors.blue,
  8. Gradient? valueGradient,
  9. RulerStyle rulerStyle = RulerStyle.none,
  10. RulerPosition rulerPosition = RulerPosition.start,
  11. int majorTickCount = 11,
  12. int minorTicksPerMajor = 4,
  13. double majorTickLength = 15.0,
  14. double minorTickLength = 8.0,
  15. Color tickColor = Colors.black54,
  16. double tickWidth = 1.5,
  17. TextStyle? labelStyle,
  18. String labelFormatter(
    1. double value
    )?,
  19. PointerConfig? pointer,
  20. bool showValueBar = true,
  21. BorderRadius? borderRadius,
  22. List<LinearGaugeRange>? ranges,
  23. bool showRangesBehind = true,
  24. Path customCurve(
    1. Size size
    )?,
  25. bool animation = false,
  26. Duration animationDuration = const Duration(milliseconds: 500),
  27. Curve animationCurve = Curves.easeInOut,
  28. bool interactive = false,
  29. OnLinearGaugeValueChanged? onValueChanged,
  30. VoidCallback? onInteractionStart,
  31. VoidCallback? onInteractionEnd,
  32. double minValue = 0,
  33. double maxValue = 100,
  34. bool showMinMaxLabels = false,
  35. bool showValueLabel = false,
  36. TextStyle? valueTextStyle,
  37. PointerPosition valueLabelPosition = PointerPosition.start,
  38. Widget? customPointerWidget,
  39. EdgeInsets padding = EdgeInsets.zero,
})

Creates a linear gauge widget.

Implementation

// ignore: sort_constructors_first
const LinearGauge({
  super.key,
  this.value = 0.0,
  this.orientation = LinearGaugeOrientation.horizontal,
  this.length,
  this.thickness = 20.0,
  this.backgroundColor = const Color(0xFFE0E0E0),
  this.valueColor = Colors.blue,
  this.valueGradient,
  this.rulerStyle = RulerStyle.none,
  this.rulerPosition = RulerPosition.start,
  this.majorTickCount = 11,
  this.minorTicksPerMajor = 4,
  this.majorTickLength = 15.0,
  this.minorTickLength = 8.0,
  this.tickColor = Colors.black54,
  this.tickWidth = 1.5,
  this.labelStyle,
  this.labelFormatter,
  this.pointer,
  this.showValueBar = true,
  this.borderRadius,
  this.ranges,
  this.showRangesBehind = true,
  this.customCurve,
  this.animation = false,
  this.animationDuration = const Duration(milliseconds: 500),
  this.animationCurve = Curves.easeInOut,
  this.interactive = false,
  this.onValueChanged,
  this.onInteractionStart,
  this.onInteractionEnd,
  this.minValue = 0,
  this.maxValue = 100,
  this.showMinMaxLabels = false,
  this.showValueLabel = false,
  this.valueTextStyle,
  this.valueLabelPosition = PointerPosition.start,
  this.customPointerWidget,
  this.padding = EdgeInsets.zero,
}) : assert(
          value >= 0.0 && value <= 1.0, 'Value must be between 0.0 and 1.0');