ListMultimap<K, V>.of constructor

ListMultimap<K, V>.of(
  1. Multimap<K, V, Iterable<V>> other, {
  2. Map<K, List<V>>? map,
  3. Factory<List<V>>? factory,
})

Creates a ListMultimap with the same keys and values as other.

Implementation

factory ListMultimap.of(Multimap<K, V, Iterable<V>> other,
    {Map<K, List<V>>? map, Factory<List<V>>? factory}) {
  final result = ListMultimap<K, V>(map: map, factory: factory);
  other.forEach(result.add);
  return result;
}