StreamMap<K, V>.from constructor
StreamMap<K, V>.from (
- Map<
K, V> other, { - OnUpdate<
Map< ? onUpdate,K, V> > - OnEvent<
CollectionEvent< ? onEvent,K, V> > - OnChange<
CollectionChangeEvent< ? onChange,K, V> >
Creates a StreamMap wrapped around a LinkedHashMap instance
that contains all key/value pairs of other
.
The keys must all be instances of K
and the values of V
.
The other
map itself can have any type.
A LinkedHashMap
requires the keys to implement compatible
operator==
and hashCode
, and it allows null
as a key.
It iterates in key insertion order.
Implementation
factory StreamMap.from(
Map<K, V> other, {
OnUpdate<Map<K, V>>? onUpdate,
OnEvent<CollectionEvent<K, V>>? onEvent,
OnChange<CollectionChangeEvent<K, V>>? onChange,
}) {
return StreamMap<K, V>(
value: Map<K, V>.from(other),
onUpdate: onUpdate,
onEvent: onEvent,
onChange: onChange,
);
}