drain method

List<T> drain(
  1. int start,
  2. int end
)

Removes the element at the given index from the Vec and returns it.

Implementation

@pragma('vm:prefer-inline')
List<T> drain(int start, int end) {
  final range = getRange(start, end).toList(growable: false);
  removeRange(start, end);
  return range;
}