map<K, V, InputK, InputV> static method
Implementation
static BcsType<Map<K, V>, Map<InputK, InputV>> map<K, V, InputK, InputV>(
BcsType<K, InputK> keyType,
BcsType<V, InputV> valueType
) {
return Bcs.vector(Bcs.tuple([keyType, valueType])).transform(
name: 'Map<${keyType.name}, ${valueType.name}>',
input: (Map<InputK, InputV> value) {
return value.entries.map((e) => [e.key, e.value]).toList();
},
output: (List<List> value) {
return Map.fromEntries(
value.map((e) => MapEntry(e[0] as K, e[1] as V))
);
},
);
}