toList property

List<int> toList

Generates a list of integers from 0 up to (but not including) this integer.

Example:

print(5.toList); // Output: [0, 1, 2, 3, 4]

Implementation

List<int> get toList => List.generate(toInt(), (index) => index);