icemanbsi / searchable_dropdown

MIT License
107 stars 162 forks source link

Cannot clear the value outside the widget searchable_dropdown #109

Closed mrazaimtiaz closed 3 years ago

mrazaimtiaz commented 3 years ago

I want to clear the selected value by clicking the raised button, but the value parameter that is provided in searchable_dropdown is not using by the package. and also there is no option to show error or style the dropdown.

Thankyou your answer and comments are high appreciated.

mrazaimtiaz commented 3 years ago

anyone looking for the answer

I resolve this using input decorator to style the dropdown and add error, and to empty the value, i used below function in the dropdown parameter

i am using bloc you can change the method what ever condition you want to add selectedValueWidgetFn: (item) { print('called ${item.CivilID}'); if (snapshot.data == null) { return Align( alignment: Alignment.center, child: Text(""), ); } else { return Align( alignment: Alignment.center, child: Text(item.CivilID), ); } },