how to modify the key of a map dart code example
Example 1: how to get key for dictionary in swift
var array_has_dictionary = [
[
"name" : "xxxx",
"age" : "xxxx",
"last_name":"xxx"
],
[
"name" : "yyy",
"age" : "yyy",
"last_name":"yyy"
],
]
cell.textLabel?.text = Array(array_has_dictionary[1])[1].key
Example 2: java map get the key from value
public static <T, E> Set<T> getKeyByValue(Map<T, E> map, E value) {
return map.entrySet()
.stream()
.filter(entry -> Objects.equals(entry.getValue(), value))
.map(Map.Entry::getKey)
.collect(Collectors.toSet());
}