【发布时间】:2021-07-25 10:49:29
【问题描述】:
此代码示例运行良好。
var box = await Hive.openBox<MainWords>('mainWords');
box.values.where((item) {
return item.category == "6" || item.category == '13';
}).toList();
我正在尝试使用 whereIn 条件过滤列表,但它必须像过滤器一样过滤
List<String> categoryList = ['6', '13'];
var box = await Hive.openBox<MainWords>('mainWords');
box.values.where((item) {
return item in categoryList; // just an examle
}).toList();
我怎样才能做到这一点?
【问题讨论】:
-
可能是
categoryList.contains(item)?,您是否尝试根据categoryList过滤值?请说明您要做什么
标签: flutter filter flutter-hive