slice method

List<E> slice(
  1. Iterable<int> indices
)

Returns a List containing elements at specified indices.

Implementation

List<E> slice(Iterable<int> indices) {
  final list = <E>[];

  for (final index in indices) {
    list.add(this[index]);
  }

  return list;
}