LinearGauge constructor
const
LinearGauge({
- Key? key,
- double value = 0.0,
- LinearGaugeOrientation orientation = LinearGaugeOrientation.horizontal,
- double? length,
- double thickness = 20.0,
- Color backgroundColor = const Color(0xFFE0E0E0),
- Color valueColor = Colors.blue,
- Gradient? valueGradient,
- RulerStyle rulerStyle = RulerStyle.none,
- RulerPosition rulerPosition = RulerPosition.start,
- int majorTickCount = 11,
- int minorTicksPerMajor = 4,
- double majorTickLength = 15.0,
- double minorTickLength = 8.0,
- Color tickColor = Colors.black54,
- double tickWidth = 1.5,
- TextStyle? labelStyle,
- String labelFormatter(
- double value
- PointerConfig? pointer,
- bool showValueBar = true,
- BorderRadius? borderRadius,
- List<
LinearGaugeRange> ? ranges, - bool showRangesBehind = true,
- Path customCurve(
- Size size
- bool animation = false,
- Duration animationDuration = const Duration(milliseconds: 500),
- Curve animationCurve = Curves.easeInOut,
- bool interactive = false,
- OnLinearGaugeValueChanged? onValueChanged,
- VoidCallback? onInteractionStart,
- VoidCallback? onInteractionEnd,
- double minValue = 0,
- double maxValue = 100,
- bool showMinMaxLabels = false,
- bool showValueLabel = false,
- TextStyle? valueTextStyle,
- PointerPosition valueLabelPosition = PointerPosition.start,
- Widget? customPointerWidget,
- 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');