从扑朔迷离的下拉搜索中删除后缀图标

发布于 2025-02-13 15:09:50 字数 1405 浏览 0 评论 0原文

我想从下拉搜索小部件中删除后缀图标。我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

锦上情书 2025-02-20 15:09:50

将可视化的属性设置为false,它将起作用。
或者您可以使用其他插件。一个是 searchfield 我使用过的。

set the isVisible property to false it will work.
or you can use other plugin. one is searchfield which i have used.

喵星人汪星人 2025-02-20 15:09:50

有一个用于下拉搜索的“下拉列表”属性,如下使用,

dropDownButton : Container(),

希望它有效

There is a 'dropDownButton' property for DropdownSearch, use it as follows

dropDownButton : Container(),

hope it works

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文