英文:
Missing selector such as '.identifier' or '[0]'. Try adding a selector
问题
TextField(
controller: _searchController,
onChanged: (value) => {
List<Job> filteredList = _jobsList.where((job) => job.data.companyCode.contains(value)).toList()
},
)
英文:
TextField(
controller: _searchController,
onChanged: (value) => {
List<Job> filtedList = _jobsList.where((job)=>job.data.companyCode.contains(value)).toList()
},
)
what i wanna do here is just filter a list, but vscode complains about the above error.
if I change to var ,also some errors occurred, what I did wrong? thanks
答案1
得分: 1
尝试删除 =>
onChanged: (value) {
List<Job> filtedList = _jobsList.where((job)=>job.data.companyCode.contains(value)).toList();
}
=>
运算符不需要 {}
包裹,它返回一行代码。
英文:
Can you try removing =>
onChanged: (value) {
List<Job> filtedList = _jobsList.where((job)=>job.data.companyCode.contains(value)).toList();
}
=>
operator doesn't required {}
enclosures, it return one liner code.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论