嗨,我有一个PaginatedDataTable,现在我想使它可搜索,以便当我键入一些关键字,它将显示根据用户键入的关键字的数据…我已经搜索了一些关于它的文章,但我还没有找到...有人知道关于它的一些教程、文章或示例吗?
发布于 2021-09-13 12:25:35
dataList: _searchController.text == ""
? widget.dataList
: searchList,
actions: [
AnimatedSearchBar(
width: 300,
textController: _searchController,
onSuffixTap: () {
setState(() {
_searchController.text = "";
});
}),)]它们是PaginatedDataTable属性
@override
void initState() {
super.initState();
if (searchableItemList.length != 0 && widget.dataList.length != 0) {
_searchController.addListener(() {
setState(() {
searchList = dataList
.where((element) => element
.name
.toLowerCase()
.contains(controller.text.toLowerCase()))
.toList();;
});
});
}}https://stackoverflow.com/questions/65366195
复制相似问题