SortedMap<K extends Comparable, V>.from constructor Null safety

SortedMap<K extends Comparable, V>.from(
  1. Map<K, V> other,
  2. [Ordering ordering = const Ordering.byKey()]
)

Creates a SortedMap that contains all key/value pairs of other.

Implementation

factory SortedMap.from(Map<K, V> other,
    [Ordering ordering = const Ordering.byKey()]) {
  return SortedMap(ordering)..addAll(other);
}