range function

List<int> range(
  1. int x,
  2. int y
)

A function that generates a list of integers between x (inclusive) and y (exclusive) using the List.generate() method. It returns the generated list.

Implementation

List<int> range(int x, int y) => List.generate(y, (i) => i).sublist(x);