fromIterable<T, I> static method
Creates a set in which the items are computed from the iterable
.
For each element of the iterable
it computes another iterable of items
by applying mapper
. The items of this resulting iterable will be added
to the set.
Implementation
static ISet<T> fromIterable<T, I>(
Iterable<I> iterable, {
required Iterable<T>? Function(I) mapper,
ConfigSet? config,
}) {
config ??= defaultConfig;
var result = ListSet.of(iterable.expand(mapper as Iterable<T> Function(I)), sort: config.sort);
return ISetImpl<T>._unsafeFromSet(result, config: config);
}