我想更改标准颤动小部件 ExpansionPanel()中使用的V形符号的颜色。这可以在 packages / flutter / lib / src / material / expansion_panel.dart 中找到。
但是我发现此人字形的图标颜色比 ExpandIcon()中的图标颜色低一级。这在 packages / flutter / lib / src / material / expand_icon.dart
中将expand_icon.dart拉入我的应用程序并更新/覆盖该硬编码颜色的正确方法是什么?
颜色定义如下:
/// Default icon colors and opacities for when [Theme.brightness] is set to
/// [Brightness.light] are based on the
/// [Material Design system icon specifications](https://material.io/design/iconography/system-icons.html#color).
/// Icon colors and opacities for [Brightness.dark] are based on the
/// [Material Design dark theme specifications](https://material.io/design/color/dark-theme.html#ui-application)
Color get _iconColor {
if (widget.isExpanded && widget.expandedColor != null) {
return widget.expandedColor;
}
if (widget.color != null) {
return widget.color;
}
switch(Theme.of(context).brightness) {
case Brightness.light:
return Colors.black54; // want to change this!!!
case Brightness.dark:
return Colors.white60; // want to change this!!!
}
assert(false);
return null;
}