range function

Iterable<num> range({
  1. num start = 0,
  2. required num stop,
  3. num step = 1,
  4. bool stopExclusive = true,
})

Handy function for grabbing a Range and iterating over it.

for (var i in range(stop: 10)) {
  print(i);
}

Implementation

Iterable<num> range({
  num start = 0,
  required num stop,
  num step = 1,
  bool stopExclusive = true,
}) {
  return Range(
    start: start,
    stop: stop,
    step: step,
    stopExclusive: stopExclusive,
  ).generate();
}