flutter - 我想更改出现在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 ..请协助..还有如何更改下拉菜单中出现的箭头图标..该过程不能作为组件使用..
解决方案
如果您查看包的源代码,我相信您无法更改下拉菜单中文本的 textStyle。
对于箭头图标,DropdownSearch 有 dropDownButton。
DropdownSearch<String>(
dropDownButton: Icon(Icons.ac_unit) // icon of your choice
)
推荐阅读
- eclipse - 用于 if 条件和函数参数对齐的 Eclipse Java 格式化程序设置
- python - 每次我从我的烧瓶应用程序将其提交到数据库时都会出错
- c++ - 为什么我们只能用原始类型或指针初始化结构?
- android - 点击 recyclerview 时隐藏浮动操作按钮 (FAB)
- django - Faker() 引发 Django ImproperlyConfigured 错误
- c# - 如何将int转换为枚举而不是使用switch
- regex - 正则表达式:在两侧的 2 个空格之间匹配单词
- python - 用小写字母、大写字母和数字对字典的键进行排序
- android - Android Studio - 如何使用我的 wifi 连接到互联网
- r - 如何以整洁的方式重新编码众多因子变量