LinearSegment constructor

const LinearSegment({
  1. required double start,
  2. required double end,
  3. required Color color,
  4. Gradient? gradient,
  5. String? label,
})

Creates a linear segment.

Implementation

// ignore: sort_constructors_first
const LinearSegment({
  required this.start,
  required this.end,
  required this.color,
  this.gradient,
  this.label,
})  : assert(
          start >= 0.0 && start <= 1.0, 'start must be between 0.0 and 1.0'),
      assert(end >= 0.0 && end <= 1.0, 'end must be between 0.0 and 1.0'),
      assert(start <= end, 'start must be <= end');