mergeList method
Merge the list with List items
.
Returns a new list with all elements of the list and items
.
Implementation
List<T> mergeList(List<T> items, {bool unique = false}) {
final list = <T>[];
list.addAll(this);
if (unique) {
for (final item in items) {
if (!list.contains(item)) list.add(item);
}
} else {
list.addAll(items);
}
return list;
}