File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,7 @@ class IconSlideAction extends ClosableSlideAction {
104
104
@required this .icon,
105
105
this .caption,
106
106
Color color,
107
+ this .foregroundColor,
107
108
VoidCallback onTap,
108
109
bool closeOnTap = _kCloseOnTap,
109
110
}) : color = color ?? Colors .white,
@@ -122,9 +123,11 @@ class IconSlideAction extends ClosableSlideAction {
122
123
/// Defaults to true.
123
124
final Color color;
124
125
126
+ final Color foregroundColor;
127
+
125
128
@override
126
129
Widget buildAction (BuildContext context) {
127
- final Color foregroundColor =
130
+ final Color estimatedColor =
128
131
ThemeData .estimateBrightnessForColor (color) == Brightness .light
129
132
? Colors .black
130
133
: Colors .white;
@@ -134,7 +137,7 @@ class IconSlideAction extends ClosableSlideAction {
134
137
style: Theme .of (context)
135
138
.primaryTextTheme
136
139
.caption
137
- .copyWith (color: foregroundColor),
140
+ .copyWith (color: foregroundColor ?? estimatedColor ),
138
141
);
139
142
return Container (
140
143
color: color,
@@ -145,7 +148,7 @@ class IconSlideAction extends ClosableSlideAction {
145
148
new Flexible (
146
149
child: new Icon (
147
150
icon,
148
- color: foregroundColor,
151
+ color: foregroundColor ?? estimatedColor ,
149
152
),
150
153
),
151
154
new Flexible (child: textWidget),
You can’t perform that action at this time.
0 commit comments