@@ -10,6 +10,7 @@ import 'chip_theme.dart';
1010import 'color_scheme.dart' ;
1111import 'colors.dart' ;
1212import 'debug.dart' ;
13+ import 'material_state.dart' ;
1314import 'text_theme.dart' ;
1415import 'theme.dart' ;
1516import 'theme_data.dart' ;
@@ -81,6 +82,7 @@ class ActionChip extends StatelessWidget implements ChipAttributes, TappableChip
8182 this .clipBehavior = Clip .none,
8283 this .focusNode,
8384 this .autofocus = false ,
85+ this .color,
8486 this .backgroundColor,
8587 this .disabledColor,
8688 this .padding,
@@ -113,6 +115,7 @@ class ActionChip extends StatelessWidget implements ChipAttributes, TappableChip
113115 this .clipBehavior = Clip .none,
114116 this .focusNode,
115117 this .autofocus = false ,
118+ this .color,
116119 this .backgroundColor,
117120 this .disabledColor,
118121 this .padding,
@@ -151,6 +154,8 @@ class ActionChip extends StatelessWidget implements ChipAttributes, TappableChip
151154 @override
152155 final bool autofocus;
153156 @override
157+ final MaterialStateProperty <Color ?>? color;
158+ @override
154159 final Color ? backgroundColor;
155160 @override
156161 final Color ? disabledColor;
@@ -188,6 +193,7 @@ class ActionChip extends StatelessWidget implements ChipAttributes, TappableChip
188193 pressElevation: pressElevation,
189194 tooltip: tooltip,
190195 labelStyle: labelStyle,
196+ color: color,
191197 backgroundColor: backgroundColor,
192198 side: side,
193199 shape: shape,
@@ -239,7 +245,15 @@ class _ActionChipDefaultsM3 extends ChipThemeData {
239245 TextStyle ? get labelStyle => _textTheme.labelLarge;
240246
241247 @override
242- Color ? get backgroundColor => null ;
248+ MaterialStateProperty <Color ?>? get color =>
249+ MaterialStateProperty .resolveWith ((Set <MaterialState > states) {
250+ if (states.contains (MaterialState .disabled)) {
251+ return _chipVariant == _ChipVariant .flat
252+ ? null
253+ : _colors.onSurface.withOpacity (0.12 );
254+ }
255+ return null ;
256+ });
243257
244258 @override
245259 Color ? get shadowColor => _chipVariant == _ChipVariant .flat
@@ -249,17 +263,9 @@ class _ActionChipDefaultsM3 extends ChipThemeData {
249263 @override
250264 Color ? get surfaceTintColor => _colors.surfaceTint;
251265
252- @override
253- Color ? get selectedColor => null ;
254-
255266 @override
256267 Color ? get checkmarkColor => null ;
257268
258- @override
259- Color ? get disabledColor => _chipVariant == _ChipVariant .flat
260- ? null
261- : _colors.onSurface.withOpacity (0.12 );
262-
263269 @override
264270 Color ? get deleteIconColor => null ;
265271
0 commit comments