deepCopy method

List<T> deepCopy({
  1. bool growable = true,
})

Returns a new List that contains a deep copy of every element from this.

IMPORTANT: Creating a deep copy of List<Map<String, int>>, Set<Map<String, int>> or any other Iterable<Map<String, int>> only works with MyUtilityExtensionDeepCopyIterable.deepCopyDynamic.

This is because of a restriction in how generic type information can be preserved when copying a Map.

Implementation

List<T> deepCopy({bool growable = true}) {
  return MyUtilityExtensionDeepCopyIterable<T>(this)
      .deepCopy(growable: growable) as List<T>;
}