@@ -41,6 +41,8 @@ class InkResponse extends StatefulWidget {
41
41
this .containedInkWell: false ,
42
42
this .highlightShape: BoxShape .circle,
43
43
this .radius,
44
+ this .highlightColor,
45
+ this .splashColor,
44
46
}) : super (key: key);
45
47
46
48
/// The widget below this widget in the tree.
@@ -71,6 +73,14 @@ class InkResponse extends StatefulWidget {
71
73
/// The radius of the ink splash.
72
74
final double radius;
73
75
76
+ /// The highlight color of the ink response. If this property is null then the
77
+ /// highlight color of the theme will be used.
78
+ final Color highlightColor;
79
+
80
+ /// The splash color of the ink response. If this property is null then the
81
+ /// splash color of the theme will be used.
82
+ final Color splashColor;
83
+
74
84
/// The rectangle to use for the highlight effect and for clipping
75
85
/// the splash effects if [containedInkWell] is true.
76
86
///
@@ -116,7 +126,7 @@ class _InkResponseState<T extends InkResponse> extends State<T> {
116
126
_lastHighlight = new InkHighlight (
117
127
controller: Material .of (context),
118
128
referenceBox: referenceBox,
119
- color: Theme .of (context).highlightColor,
129
+ color: config.highlightColor ?? Theme .of (context).highlightColor,
120
130
shape: config.highlightShape,
121
131
rectCallback: config.getRectCallback (referenceBox),
122
132
onRemoved: () {
@@ -143,7 +153,7 @@ class _InkResponseState<T extends InkResponse> extends State<T> {
143
153
controller: Material .of (context),
144
154
referenceBox: referenceBox,
145
155
position: referenceBox.globalToLocal (details.globalPosition),
146
- color: Theme .of (context).splashColor,
156
+ color: config.splashColor ?? Theme .of (context).splashColor,
147
157
containedInkWell: config.containedInkWell,
148
158
rectCallback: config.containedInkWell ? rectCallback : null ,
149
159
radius: config.radius,
@@ -241,7 +251,9 @@ class InkWell extends InkResponse {
241
251
GestureTapCallback onTap,
242
252
GestureTapCallback onDoubleTap,
243
253
GestureLongPressCallback onLongPress,
244
- ValueChanged <bool > onHighlightChanged
254
+ ValueChanged <bool > onHighlightChanged,
255
+ Color highlightColor,
256
+ Color splashColor,
245
257
}) : super (
246
258
key: key,
247
259
child: child,
@@ -250,6 +262,8 @@ class InkWell extends InkResponse {
250
262
onLongPress: onLongPress,
251
263
onHighlightChanged: onHighlightChanged,
252
264
containedInkWell: true ,
253
- highlightShape: BoxShape .rectangle
265
+ highlightShape: BoxShape .rectangle,
266
+ highlightColor: highlightColor,
267
+ splashColor: splashColor,
254
268
);
255
269
}
0 commit comments