首页 > 解决方案 > 我想更改出现在DropdownSearch中的项目的TextStyle,它位于flutter中的dropdown_search包下

问题描述

Transform.scale(规模:0.91,孩子:DropdownSearch(验证器:(v)=> v == null?“必填字段”:null,提示:“选择一个国家”,dropdownSearchDecoration:InputDecoration(

              //filled: true,
              //fillColor: Theme.of(context).inputDecorationTheme.fillColor,
            ),
            mode: Mode.MENU,
            showSelectedItem: false,
            items: [
              "India",
              "Maldeep",
              "Austria",
              "Phillipins",
              "Itly",
            ],
            
            label: "No of Auto Print",
            
            showClearButton: false,
            
            //onChanged: print,
            //popupItemDisabled: (String s) => s.startsWith('I'),
            selectedItem: "India",


            
            
          ),
        ),

在这里,我想更改下拉列表中项目的字体系列..也是 selectedItem ..请协助..还有如何更改下拉菜单中出现的箭头图标..该过程不能作为组件使用..

标签: flutterdrop-down-menuiconsproceduretextstyle

解决方案


如果您查看包的源代码,我相信您无法更改下拉菜单中文本的 textStyle。

对于箭头图标,DropdownSearch 有 dropDownButton。

DropdownSearch<String>(
  dropDownButton: Icon(Icons.ac_unit) // icon of your choice
)

推荐阅读