ComputedMap<K, V>.fromPiecewise constructor
ComputedMap<K, V>.fromPiecewise (
- Iterable<
K> domain, - V f(
- K key
Constructs a constant ComputedMap defined by f
over the key domain domain
.
The main advantage over ComputedMap.fromIMap is that only the reactively used keys are computed.
Make sure either:
domain
is finite or- snapshot is never used.
Implementation
factory ComputedMap.fromPiecewise(Iterable<K> domain, V Function(K key) f) =>
PiecewiseComputedMap(domain, f);