Метод intersection
Создает новый набор, который является пересечением этого набора и other.
То есть, полученный набор содержит все элементы этого набора, которые также являются элементами other в соответствии с other.contains.
final characters1 = <String>{'A', 'B', 'C'};
final characters2 = <String>{'A', 'E', 'F'};
final unionSet = characters1.intersection(characters2);
print(unionSet); // {A} Реализация
Set<E> intersection(Set<Object?> other);
© 2012 the Dart project authors
Licensed under the BSD 3-Clause "New" or "Revised" License.
https://api.dart.dev/stable/2.18.5/dart-core/Set/intersection.html