首页 > 解决方案 > 如何在颤动的列表中使用多个位置?

问题描述

我正在尝试在我的应用程序中添加搜索逻辑。我有一个包含“标题”和“网址”字段的列表。我处理了这个,但我想同时搜索标题和 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);

标签: flutterdartflutter-hive

解决方案


推荐阅读