Collections
Maps
Insert and Lookup
A map literal {key: value, ...} builds a key-value store. Assigning to a missing key inserts it.
Program
Play the program to insert one entry and read another.
maps.dart
void main() {
var scores = {'Ada': 9, 'Lin': 12};
scores['Mia'] = 6;
print(scores['Lin']);
}
map literal
`{'Ada': 9, ...}` is a `Map<String, int>`.
insert
`scores['Mia'] = 6` inserts a new entry.
lookup
`scores['Lin']` reads a value by key.