dart for map code example
Example 1: dart map foreach
void main() {
var usrMap = {"name": "Tom", 'Email': '[email protected]'};
usrMap.forEach((k,v) {
print('${k}: ${v}');
});
}
Example 2: Map in dart
void main() {
var details = new Map();
details['Usrname'] = 'admin';
details['Password'] = 'admin@123';
print(details);
}
// Output
// {Usrname: admin, Password: admin@123}