deepCopyList<T> function

List<T>? deepCopyList<T>(
  1. List<T>? l, {
  2. Copier? copier,
})

Deeply copies list.

copier Copy Function for non-primitive types.

Implementation

List<T>? deepCopyList<T>(List<T>? l, {Copier? copier}) {
  if (l == null) return null;
  if (l.isEmpty) return <T>[];
  return l.map((T e) => deepCopy(e, copier: copier)!).toList();
}