copy method

List<T> copy()

The collection object is copied, but the elements of the collection content are not copied.

Implementation

List<T> copy() {
  final List<T> list = [];
  for (var i = 0; i < length; i++) {
    list.add(this[i]);
  }
  return list;
}