从扑朔迷离的下拉搜索中删除后缀图标
我想从下拉搜索小部件中删除后缀图标。我正在使用 dropdown_search 插件。 我尝试给图标尺寸,并增加了可见性错误。但是其中任何一个都没有用。 甚至我也尝试使用下拉构建器。
请帮忙.. !!
DropdownSearch<String>(
dropdownBuilder: (context, str) {
return Text(str ?? "-");
},
dropdownDecoratorProps: DropDownDecoratorProps(
textAlign: TextAlign.left,
textAlignVertical: TextAlignVertical.center,
dropdownSearchDecoration: _appTheme.dropDownDecoration()),
dropdownButtonProps: const DropdownButtonProps(
alignment: Alignment.centerRight,
padding: EdgeInsets.all(0),
icon: SizedBox(
width: 0,
child: Visibility(
visible: false,
child: Icon(
Icons.arrow_downward,
size: 0,
)),
),
isVisible: false,
constraints: BoxConstraints(maxWidth: 0, maxHeight: 0),
iconSize: 0),
popupProps: PopupProps.menu(
textStyle: _appTheme.textFiledStyle,
showSelectedItems: true,
showSearchBox: true,
),
items: _registrationBloc.countries,
onChanged: (value) {
_registrationBloc.selectedCountry = value;
},
selectedItem: _registrationBloc.selectedCountry,
)
I want to remove suffix icon from DropdownSearch widget. I am using dropdown_search plugin.
I have tried giving size to icon and also added visibility false. but any of these didn't work.
Even I have tried using dropdown builder too..!!
Please help..!!
DropdownSearch<String>(
dropdownBuilder: (context, str) {
return Text(str ?? "-");
},
dropdownDecoratorProps: DropDownDecoratorProps(
textAlign: TextAlign.left,
textAlignVertical: TextAlignVertical.center,
dropdownSearchDecoration: _appTheme.dropDownDecoration()),
dropdownButtonProps: const DropdownButtonProps(
alignment: Alignment.centerRight,
padding: EdgeInsets.all(0),
icon: SizedBox(
width: 0,
child: Visibility(
visible: false,
child: Icon(
Icons.arrow_downward,
size: 0,
)),
),
isVisible: false,
constraints: BoxConstraints(maxWidth: 0, maxHeight: 0),
iconSize: 0),
popupProps: PopupProps.menu(
textStyle: _appTheme.textFiledStyle,
showSelectedItems: true,
showSearchBox: true,
),
items: _registrationBloc.countries,
onChanged: (value) {
_registrationBloc.selectedCountry = value;
},
selectedItem: _registrationBloc.selectedCountry,
)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将可视化的属性设置为false,它将起作用。
或者您可以使用其他插件。一个是 searchfield 我使用过的。
set the isVisible property to false it will work.
or you can use other plugin. one is searchfield which i have used.
有一个用于下拉搜索的“下拉列表”属性,如下使用,
希望它有效
There is a 'dropDownButton' property for DropdownSearch, use it as follows
hope it works