toList abstract method

List<int> toList()

Collects the elements into a List.

Example

final list = IntStream.range(1, 5).toList(); // [1, 2, 3, 4]

Implementation

List<int> toList();