Dart Programming - Collection Maps



The Map object is a simple key/value pair. Keys and values in a map may be of any type. A Map is a dynamic collection. In other words, Maps can grow and shrink at runtime. The Map class in the dart:core library provides support for the same.

Example

void main() { 
  var details = new Map(); 
  details['Usrname']='admin'; 
  details['Password']='admin@123'; 
  print(details); 
}     

It should produce the following output

{Usrname: admin, Password: admin@123} 

Note − The generic implementations of List and Map has been discussed in detailed in the previous chapters.

dart_programming_collection.htm
Advertisements