【发布时间】:2021-03-22 14:20:18
【问题描述】:
我只是在其他数组中检查我的 ids 数组。在一个数组中,我在数组中有一堆 id,我正在过滤存在 id 的第二个数组。
我的代码
Future<List> dosomestuff() async {
var map = globalCategoryProduct.globalCategoryProductArray;
print(map);
print(WishList.wishlistArray);
if (map.length > 1) {
//print('show kr ');
var data = map;
data.forEach(
(category) {
print(category);
final filteredItemsToAdd = category
.where((item) => WishList.wishlistArray.contains(item['ItemID']));
print(filteredItemsToAdd);
},
);
if (items['Items'].length >= 1) {
setState(() {
show = true;
});
}
}
}
我有一些像这样的全局数组的助手
class globalCategoryProduct {
static var globalCategoryProductArray = [];
}
class WishList {
static var wishlistArray = [];
}
我在这些全局数组中添加数组,然后在其他屏幕上获取。
But dont know why its showing error of Class '_InternalLinkedHashMap<String, dynamic>' has no instance method
【问题讨论】: