flutter - 如何在颤动的列表中使用多个位置?
问题描述
我正在尝试在我的应用程序中添加搜索逻辑。我有一个包含“标题”和“网址”字段的列表。我处理了这个,但我想同时搜索标题和 url 字段。
ValueListenableBuilder<Box<Record>>(
valueListenable: Boxes.getRecord().listenable(),
builder: (context, box, _) {
final records = box.values.toList().cast<Record>();
List<Record> filteredRecords = records
.where((record) =>
record.title.containsIgnoreCase(_searchTextController.text))
.toList();
return buildContent(context, filteredRecords);
解决方案
推荐阅读
- c# - 列表中的 union vs addrange,哪个是最快且性能好的?
- pandas - 我想获取数据框的小时范围
- java - 键入字符串时从字符串中删除字符
- ruby-on-rails - 如何在控制器中测试实例变量?
- r - 取n维数组并在r中绑定n-1维数组
- python - 默认情况下何时从 Python 中删除“请求”模块?
- python - 将 self 解析为列表,而不是字符串
- java - Java 字符串规范化
- c++ - 在 C++ 中使用数组比在 matlab 中使用向量慢,不知道为什么
- ruby - 将jekyll与gitlab页面一起使用,它说当它使用gitlab CI部署网站时找不到主题,我已经安装了它