drain method

Vec<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')
Vec<T> drain(int start, int end) {
  final range = getRange(start, end).toList();
  removeRange(start, end);
  return range;
}