如何在Flutter中更改ButtonBar的颜色?据我所知,ButtonBarTheme中没有一种颜色。我正在尝试这样做:
return Scaffold(
backgroundColor: Colors.red,
body: Center(child: Text('foo')),
// Somehow get the color of these buttons different to backgroundColor
persistentFooterButtons: _buildTextButtons(),
);
目前我能想到的最好的办法就是自己重新实现持
使用DropdownButton时,我需要所选项目的颜色与点击按钮时出现的下拉菜单中的项目列表的颜色不同。根据the Flutter documentation的说法,我应该使用selectedItemBuilder。正如在the example within the documentation中可以看到的,使用selectedItemBuilder的结果是选中的文本被上移了,这看起来不太好。 ? 如何在菜单项和所选项具有不同颜色的情况下,使所选项目与下拉图标保持一致?