dart list map function 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: dart list to map
var map1 = Map.fromIterable(list, key: (e) => e.name, value: (e) => e.age);
Example 3: dart list of maps
var orderLines = <Map>[]; // creates an empty List<Map>
orderLines.add({ 'number' : '',
'Item' : '',
'Qty' : ''
});