arange function

Array arange({
  1. double start = 0,
  2. required double end,
  3. double step = 1,
})

Implementation

Array arange({double start = 0, required double end, double step = 1}) {
  assert(step != 0);

  var _range = range(start: 0, end: ((end - start) / step).ceil(), step: 1);
  var result = [
    for (var x in _range) [x * step + start]
  ];

  return Array(values: result);
}