Read our article on Maps for an explanation of these blocks.
Creates a new, empty map. Usually, you'll assign it to a map attribute right away.
new Map<String, Dynamic>()
Returns a shallow copy of the map.
Utils.copyMap(map)
Assigns the specified key to the given value for this map.
map.set([TEXT], [VALUE]);
Removes the entry for the specified key from the map.
map.remove([TEXT]);
Removes all entries from the map.
for(key in map.keys()) {
map.remove(key);
}
Returns the entry for the given key, or null if it doesn't exist.
map.get([TEXT])
Returns true
if an entry exists for the given key.
map.exists([TEXT])
Returns true
if the value exists in the map.
Utils.mapContainsValue(map, [VALUE])
Returns the number of entries in the map.
Utils.mapCount(map)
Returns true
if the map contains no entries.
Utils.mapCount(map) == 0
Returns the list
of [keys or values] for this map. No specific order is guaranteed. (In other words, do not count on it being the same order in which you added the entries.)
Utils.mapToList(map, "keys")
Utils.mapToList(map, "values")
Lets you perform logic on each item in the map. Use the embedded item
block to retrieve the current item being examined.
//loop over keys
for(item in map.keys()) {
[ACTION]
}
//loop over values
for(item in map) {
[ACTION]
}