如何在 Dart 中将 [[1,2],[3,4]]
转换为 [[1,3],[2,4]]
?
最佳答案
你的问题应该详细一点。您应该概括背后的逻辑。
根据您的具体情况,解决方案可能是:
const myList = [[1, 2],[3, 4]];
final newList = [myList.map((e) => e.first).toList(), myList.map((e) => e.last).toList()];
关于list - 转换列表架构的列表 : [[1, 2],[3,4]] -> [[1,3],[2,4]],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75132829/