1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| president.forEach( (key, value){ print("forEach 遍历 : $key : $value"); } );
for (var key in president.keys){ print("for 循环遍历 : Key : $key , Value : ${president[key]}"); }
Map president2 = president.map( (key, value){ return MapEntry(value, key); } );
print(president2);
|