flutter - 如何在颤动中更改 SearchDelegate StatusBarIcons 颜色或 buildSuggestions 正文颜色?
问题描述
在我的 AppBar 中,我的 StatusBarIcons 的颜色是白色的,只是因为 auf "Brightness.dark" 如果我在我的 SearchDelegate 窗口中使用它,那么主体颜色也很暗。如果我只是将 primaryColor 更改为灰色,那么 StatusBarIcons 仍然是黑色的。有没有人有解决这些案例的想法?
加:如何更改光标下方的蓝色图标/气泡以及白色和绿色的两个下划线,图4?
解决方案
仍然打开:光标下方的蓝色图标/气泡
但对于我当前的解决方案,请参阅代码注释:
@override
ThemeData appBarTheme(BuildContext context) {
return ThemeData(
accentColor: Color(0xFF323232), // for the green line
scaffoldBackgroundColor: Colors.white, // for the body color
brightness: Brightness.dark, // to get white statusbar icons
primaryColor: Color(0xFF323232), // set background color of SearchBar
textSelectionTheme: TextSelectionThemeData(cursorColor: Colors.white), // cursor color
textTheme: TextTheme(
headline6: TextStyle(
decorationColor: Color(0xFF323232), // color of text underline
),
),
);
}
如果有人想测试所有 ThemeData 颜色:
backgroundColor: Colors.red,
bottomAppBarColor: Colors.red,
canvasColor: Colors.red,
cardColor: Colors.red,
buttonColor: Colors.red,
dialogBackgroundColor: Colors.red,
disabledColor: Colors.red,
dividerColor: Colors.red,
errorColor: Colors.red,
focusColor: Colors.red,
highlightColor: Colors.red,
hintColor: Colors.red,
hoverColor: Colors.red,
indicatorColor: Colors.red,
primaryColorDark: Colors.red,
primaryColorLight: Colors.red,
secondaryHeaderColor: Colors.red,
selectedRowColor: Colors.red,
shadowColor: Colors.red,
splashColor: Colors.red,
toggleableActiveColor: Colors.red,
unselectedWidgetColor: Colors.red,
accentColor: Colors.red,
scaffoldBackgroundColor: Colors.white,
primaryColor: Colors.red,
推荐阅读
- css - 填充顶部解决方案不适用于引导固定顶部导航栏问题
- html - 如何有粗体字?
- swift - 在播放背景音频的本机应用程序中使用相机?(就像来自音乐应用程序的歌曲)
- azure - 如何使用托管标识创建网站 ARM 模板?
- laravel-5 - 规划一个 laravel 应用程序 - MVC 灾难
- r - 在 r 中调整 grob 对象的边距
- node.js - 将 .inv 添加到 req,session 后网站超时
- python - 恢复 pytorch 模型训练会引发错误“CUDA out of memory”
- sql - 来自查询的 Oracle SQL 过滤结果
- python - 在python中为类创建链方法