mapToSet<R> method

Set<R> mapToSet<R>(
  1. R toElement(
    1. T e
    ), {
  2. bool modifiable = false,
})

Creates a Set with all elements of this Iterable modified by toElement.

The Set is modifiable if modifiable is true.

Implementation

Set<R> mapToSet<R>(R Function(T e) toElement, {bool modifiable = false}) {
  return modifiable
      ? map<R>(toElement).toSet()
      : map<R>(toElement).toUnmodifiableSet();
}