diff<V> function

List<V> diff<V>(
  1. Iterable<V> listA,
  2. Iterable<V> listB
)

Elements that you have in listA and do not have in listB.

Implementation

List<V> diff<V>(Iterable<V> listA, Iterable<V> listB) {
  final List<V> diff = <V>[];
  for (final V value in listA) {
    if (!listB.contains(value)) {
      diff.add(value);
    }
  }
  return diff;
}