下拉搜索颤音 - 字体太大
我有以下flutter中的下拉搜索的代码 字体已固定并且不会更改
但是,当我更改屏幕大小输入图像描述时,
DropdownSearch<String>(
items: items,
showSearchBox: showSearchBox ?? false,
dropdownSearchDecoration: InputDecoration(
contentPadding: const EdgeInsets.only(right: 8.0, left: 8.0),
floatingLabelStyle:
kResponsiveTextUbuntuFont(context, kDarkGreyColor),
labelText: labelTxt,
labelStyle: kResponsiveTextUbuntuFont(context, kDarkGreyColor),
focusedBorder: const OutlineInputBorder(
borderSide: BorderSide(color: kDarkGreyColor, width: 2),
),
border: const OutlineInputBorder(
borderSide: BorderSide(color: kDarkGreyColor, width: 2),
),
),
onChanged: (newItem) => {},
showSelectedItems: true,
selectedItem: selectedItem,
popupBackgroundColor: kBackgroundColor,
dropdownSearchBaseStyle:
kResponsiveTextUbuntuFont(context, kDarkGreyColor),
mode: Mode.MENU,
),
。字体:
TextStyle KResponsiveTitleUbuntuFont(BuildContext context, Color color) {
return TextStyle(
fontFamily: 'Ubuntu',
fontSize:
(setWidth(context, 0.001) >= 1) ? 30 * setWidth(context, 0.001) : 50,
fontWeight: FontWeight.w100,
wordSpacing: 5,
color: color);
}
I have the following code for the dropdownSearch in Flutter
However, the font is fixed and does not change when I change the screen size
DropdownSearch<String>(
items: items,
showSearchBox: showSearchBox ?? false,
dropdownSearchDecoration: InputDecoration(
contentPadding: const EdgeInsets.only(right: 8.0, left: 8.0),
floatingLabelStyle:
kResponsiveTextUbuntuFont(context, kDarkGreyColor),
labelText: labelTxt,
labelStyle: kResponsiveTextUbuntuFont(context, kDarkGreyColor),
focusedBorder: const OutlineInputBorder(
borderSide: BorderSide(color: kDarkGreyColor, width: 2),
),
border: const OutlineInputBorder(
borderSide: BorderSide(color: kDarkGreyColor, width: 2),
),
),
onChanged: (newItem) => {},
showSelectedItems: true,
selectedItem: selectedItem,
popupBackgroundColor: kBackgroundColor,
dropdownSearchBaseStyle:
kResponsiveTextUbuntuFont(context, kDarkGreyColor),
mode: Mode.MENU,
),
Font:
TextStyle KResponsiveTitleUbuntuFont(BuildContext context, Color color) {
return TextStyle(
fontFamily: 'Ubuntu',
fontSize:
(setWidth(context, 0.001) >= 1) ? 30 * setWidth(context, 0.001) : 50,
fontWeight: FontWeight.w100,
wordSpacing: 5,
color: color);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在问自己的问题XD之后,我总是直接找到解决方案...
这是解决方案:
构建:
解决方案
I always find the solution directly after asking my own question xD...
Here's the solution:
Build:
solution