drain method
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;
}