deepCopy method

List<E> deepCopy()

Implementation

List<E> deepCopy() {
  var newList = [];

  forEach((el) {
    if (el is List) {
      newList.add(el.deepCopy());
    } else if (el is Set) {
      newList.add((el.deepCopy()));
    } else if (el is Map) {
      newList.add((el.deepCopy()));
    } else {
      newList.add(el);
    }
  });

  return newList.cast<E>();
}