toDartMap<K, V> method
Convert this CBOR map to a Dart Map<K, V> by mapping keys and values.
keyMapper → transforms each CBOR key to K
valueMapper → transforms each CBOR value to V
Implementation
Map<K, V> toDartMap<K, V>(
CbCborKeyMapper<K> keyMapper,
CbCborKeyMapper<V> valueMapper,
) {
final entries = value.entries.map((e) {
return MapEntry<K, V>(keyMapper(e.key), valueMapper(e.value));
});
return Map<K, V>.fromEntries(entries);
}