select_dialog
select_dialog copied to clipboard
Custom Search Filtering
Hi guys! :heart:
Thank you so much for this amazing tool!
I would like to know if we can please override the default filtering. I am using the itemBuilder to build a list of a ICD10 model of mine. The documentation did not really go into detail about that part. The model has an id, code and description in its fields.
_showICD10Dialog() {
List<ICD10> ex5 = [];
SelectDialog.showModal<ICD10>(
context,
label: "ICD10 Codes",
multipleSelectedValues: ex5,
items: _allICD10,
onMultipleItemsChange: (List<ICD10> selected) {
setState(() {
ex5 = selected;
});
},
itemBuilder: (BuildContext context, ICD10 icd10, bool isSelected) {
return Container(
decoration: !isSelected
? null
: BoxDecoration(
borderRadius: BorderRadius.circular(5.0),
color: Colors.white,
border: Border.all(
color: Theme.of(context).primaryColor,
),
),
child: ListTile(
selected: isSelected,
title: Text(icd10.icd10Code),
subtitle: Text(icd10.icd10Description),
),
);
},
);
How can I make sure that it filters the code and description of the search?