📜  颤动列表映射 - 任何代码示例

📅  最后修改于: 2022-03-11 14:55:12.505000             🧑  作者: Mango

代码示例1
List list = [ ('a', (1,2)), ('b', (2,3)), ('c', (3,4)) ]

// Dart >= 2.3:
var result = { for (var v in list) v[0]: v[1] };

// Dart < 2.3
var result = Map.fromIterable(list, key: (v) => v[0], value: (v) => v[1]);