I am looking for a Flutter Plugin to use in one of my POC projects. Idea is to create a dropdown field with a search option, something similar to what you can see on Yatra(dot)com.
It will be really helpful if someone can guide me to create a widget by myself to achieve this.
Any guidance is highly appreciated.
Have a look in this site and try out this code
Container(
child: DropdownSearch<String>(
mode: Mode.DIALOG,
showSearchBox: true,
searchBoxDecoration: InputDecoration(
filled: true,
fillColor: Colors.grey,
),
showAsSuffixIcons: true,
showClearButton: false,
dropdownButtonBuilder: (_) => Padding(
padding: const EdgeInsets.all(8.0),
child: const Icon(
Icons.arrow_drop_down,
size: 24,
color: Colors.red,
),
),
showSelectedItem: true,
items: ["bs", "test", "company"],
onChanged: (String newValue) {
setState(() {
// dropDownValue = newValue;
});
},
// selectedItem: dropDownValue,
),
),
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.