In this guide, we will discuss Map.addAll() Function in Dart Programming Language. The Map.addAll() function adds all key-value pairs of other to this map.
Syntax
Map.addAll(Map<K, V> other)
Parameter
- other − represents a key value pair.
Return Type − void
Example
void main() { Map m = {'name':'Tom','Id':'E1001'}; print('Map :${m}'); m.addAll({'dept':'HR','email':'tom@xyz.com'}); print('Map after adding entries :${m}'); }
It will produce the following output −
Map : {name: Tom, Id: E1001} Map after adding entries : {name: Tom, Id: E1001, dept: HR, email: tom@xyz.com}
Next Topic : Click Here
Pingback: Dart Programming - Map Property isNotEmpty | Adglob Infosystem Pvt Ltd
Pingback: Dart Programming - Map | Adglob Infosystem Pvt Ltd