Map In Flutter:
Map in dart
Map
- Map is collection of key/value pairs. You can retrieve or iterator a value and key.
- Map instance with the default implementation, [LinkedHashMap].
var mapData = new Map();
mapData['username'] = 'admin';
mapData['password'] = 'admin';
print(mapData);
Which is use
- HashMap - unordered (no order is guaranteed). HashMap<String, String> oo = new HashMap<String, String>();
- LinkedHashMap - key insertion order
- sorted map - keys in sorted order
- SplayTreeMap - selef - balancing binary tree. Allow recently accessed elements to be fast.
LinkedHashMap
- It allows `null` as a key.
Iterat / get data (flutter how to get data Map or HashMap)
HashMap<String, String> hashMapFlutter = new HashMap<String, String>();
hashMapFlutter.forEach((k,v) => print(k));