I am new in flutter, I want to create a searchable dropdown in Textformfield in flutter. Like below-
I want to show icons in left side and text to the right as shown in image. When i click on any suggest item it should be go inside textformfield. Data will be loaded from server. I will receive icons and text in json format from server api call. Please provide me any solution to achieve that.
Container(
child: SearchableDropdown(
value: _bankChoose,
isCaseSensitiveSearch: true,
items: bankDataList != null
? bankDataList.map<
DropdownMenuItem<
BankListDataModel>>(
(BankListDataModel value) {
return DropdownMenuItem(
value: value,
child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
new CircleAvatar(
backgroundImage:
new NetworkImage(
value.bank_logo),
backgroundColor: Colors.white,
radius: 12,
),
// Icon(valueItem.bank_logo),
SizedBox(
width: 15,
),
Text(value.bank_name, style: TextStyle(fontSize: 14, fontFamily: "verdana_regular",
color: text_gray_color, fontWeight: FontWeight.w500),),
],
),
);
}).toList()
: null,
isExpanded: true,
hint: "Select one",
searchHint: "Select one",
onChanged: (BankListDataModel newSelectedBank) {
setState(() {
_onDropDownItemSelected(newSelectedBank);
print("selected Bank name " + _bankChoose.bank_name);
});
},
),
),