This code is working, but I am not getting the output I want. I want to show this screen in a container but it's not working. It's not opening in a container but instead directly opening as a different page.
I am using the flutter filter_list: ^1.0.2 plugin in this code.
I want to show this search bar with a list in a container on the same page.
List<SelectProjectData?> _selectProjectData = [];
openFilterDelegate() async {
await FilterListDelegate.show<SelectProjectData?>(
context: context,
list: _selectProjectData,
selectedListData: _selectedProjectData,
onItemSearch: (user, query) {
return user!.projectName!.toLowerCase().contains(query.toLowerCase());
},
tileLabel: (user) => user!.projectName,
emptySearchChild: const Center(child: Text('Data not found')),
// enableOnlySingleSelection: true,
searchFieldHint: 'Search Here..',
onApplyButtonClick: (list) {
setState(() {
_selectedProjectData = list!;
});
},
);
}
Try to call this in the column:- here you can find the code
Container(
margin: EdgeInsets.all(10),
padding: EdgeInsets.all(20),
color: AppColor.WHITE,
child:
Column(
children: [
openFilterDelegate(),
],
),
);
The final result is this:-
