📙 Map
Use the dictionary-like Dart Map to manage key-value pairs
Basic Maps
maps.dart
Map<String, dynamic> book = {
'title': 'Moby Dick',
'author': 'Herman Melville',
'pages': 752,
};
book['title'];
book['published'] = 1851;
Loop over a Map
maps.dart
book.keys;
book.values;
book.values.toList();
for (MapEntry b in book.entries) {
print('Key ${b.key}, Value ${b.value}');
}
book.forEach((k, v) => print("Key : $k, Value : $v"));