NumberLine<T extends num> constructor

NumberLine<T extends num>(
  1. T start,
  2. T end, {
  3. T? step,
})

Creates a memory-efficient sequence from start to end exclusive, incrementing by step.

Implementation

NumberLine(this.start, this.end, {T? step})
  : step = step ?? _defaultStep(start),
    _initStart = start,
    _initEnd = end,
    _initStep = step ?? _defaultStep(start) {
  if (this.step == 0) {
    throw ArgumentError('Step cannot be zero.');
  }
}