union method

Set<T> union(
  1. Iterable<T> other
)

Returns a set containing all distinct elements from both collections.

Implementation

Set<T> union(Iterable<T> other) {
  final set = toSet();
  set.addAll(other);
  return set;
}