CanonicalizedMap<C, K, V> constructor
Null safety
- C canonicalize(
- K key
- {bool isValidKey(
- K key
Creates an empty canonicalized map.
The canonicalize
function should return the canonical value for the
given key. Keys with the same canonical value are considered equivalent.
The isValidKey
function is called before calling canonicalize
for
methods that take arbitrary objects. It can be used to filter out keys
that can't be canonicalized.
Implementation
CanonicalizedMap(C Function(K key) canonicalize,
{bool Function(K key)? isValidKey})
: _canonicalize = canonicalize,
_isValidKeyFn = isValidKey;