xxxxxxxxxx
var usdKey = curr.keys.firstWhere(
(k) => curr[k] == 'USD', orElse: () => null);
xxxxxxxxxx
var usdKey = curr.keys.firstWhere(
(k) => curr[k] == 'USD', orElse: () => null);
xxxxxxxxxx
{
"123": 123,
123: "123",
false: {
"123": false,
true: {
"Print This Item",
}
},
}
xxxxxxxxxx
// adding keys
var colors = new Map();
colors['blue'] = false;
colors['red'] = true;
print(colors);
// curly bracket literals can also be used:
var shapes = {
'square': false,
'triangle': true
};
print(shapes);
// keys and values can be iterated.
// HashMap iterates in arbitrary order, while LinkedHashMap, and SplayTreeMap
// iterate in the order they were inserted into the map.
for (var key in shapes.keys) print(key);
for (var value in shapes.values) print(value);
}
xxxxxxxxxx
void main() {
var details = {'Usrname':'tom','Password':'pass@123'};
print(details.values);
}