GaugeRange constructor

GaugeRange({
  1. Key? key,
  2. required double startValue,
  3. required double endValue,
  4. double? startWidth,
  5. double? endWidth,
  6. GaugeSizeUnit sizeUnit = GaugeSizeUnit.logicalPixel,
  7. Color? color,
  8. Gradient? gradient,
  9. double rangeOffset = 0,
  10. String? label,
  11. GaugeTextStyle? labelStyle,
})

Create a range with the default or required properties.

The arguments startValue, endValue, must not be null.

Implementation

GaugeRange(
    {Key? key,
    required this.startValue,
    required this.endValue,
    double? startWidth,
    double? endWidth,
    this.sizeUnit = GaugeSizeUnit.logicalPixel,
    this.color,
    this.gradient,
    this.rangeOffset = 0,
    this.label,
    GaugeTextStyle? labelStyle})
    : startWidth =
          startWidth = startWidth ?? (label != null ? startWidth : 10),
      endWidth = endWidth = endWidth ?? (label != null ? endWidth : 10),
      labelStyle = labelStyle ?? const GaugeTextStyle(),
      assert(
          (gradient != null && gradient is SweepGradient) || gradient == null,
          'The gradient must be null or else the gradient must be equal'
          ' to sweep gradient.'),
      super(key: key);