create map in dart code example

Example 1: Map in dart

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

// Output
// {Usrname: admin, Password: admin@123}

Example 2: flutter create new map

Map<String, int> map1 = {'zero': 0, 'one': 1, 'two': 2};
Map map2 = {'zero': 0, 'I': 'one', 10: 'X'};
var map3 = {'zero': 0, 'I': 'one', 10: 'X'};

Example 3: what is map in dart

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

Tags:

Dart Example