rangeToInclusive method
Returns a list of integers from this number to end (inclusive).
Example:
1.rangeToInclusive(5); // [1, 2, 3, 4, 5]
Implementation
List<int> rangeToInclusive(int end) {
if (end < this) {
return <int>[];
}
return List<int>.generate(end - this + 1, (int index) => this + index);
}