我正在尝试对我拥有的Map
数据如下:
[
{
orderedDate1: [itemsHere...], // The date that I am trying to compare and sort
Total: 123.00,
},
{
orderedDate2: [itemsHere...], // The date that I am trying to compare and sort
Total: 223.00,
},.....
]
我已经研究过SplayTreeMap之类的东西,但这似乎仅适用于字典中的1个键?与之类似,我只想比较orderedDate
键而不是Total
键,但是我的代码会继续比较这两个
以下是我尝试过的内容:
var sorted = SplayTreeMap<String, dynamic>.from(orderData, (a, b) {
return a.compareTo(b);
}); // Didn't work for me
order.data().keys.toList()..sort(); //Didn't work for me
感谢您的帮助