@@ -52,6 +52,8 @@ public interface ChipAttributes {
52
52
MaterialTapTargetSize ? materialTapTargetSize { get ; }
53
53
54
54
float ? elevation { get ; }
55
+
56
+ Color shadowColor { get ; }
55
57
}
56
58
57
59
public interface DeletableChipAttributes {
@@ -76,6 +78,8 @@ public interface SelectableChipAttributes {
76
78
string tooltip { get ; }
77
79
78
80
ShapeBorder avatarBorder { get ; }
81
+
82
+ Color selectedShadowColor { get ; }
79
83
}
80
84
81
85
public interface DisabledChipAttributes {
@@ -108,7 +112,8 @@ public Chip(
108
112
Color backgroundColor = null ,
109
113
EdgeInsets padding = null ,
110
114
MaterialTapTargetSize ? materialTapTargetSize = null ,
111
- float ? elevation = null
115
+ float ? elevation = null ,
116
+ Color shadowColor = null
112
117
) : base ( key : key ) {
113
118
D . assert ( label != null ) ;
114
119
D . assert ( elevation == null || elevation >= 0.0f ) ;
@@ -126,6 +131,7 @@ public Chip(
126
131
this . _padding = padding ;
127
132
this . _materialTapTargetSize = materialTapTargetSize ;
128
133
this . _elevation = elevation ;
134
+ this . _shadowColor = shadowColor ;
129
135
}
130
136
131
137
public Widget avatar {
@@ -212,6 +218,12 @@ public float? elevation {
212
218
213
219
float ? _elevation ;
214
220
221
+ public Color shadowColor {
222
+ get { return this . _shadowColor ; }
223
+ }
224
+
225
+ Color _shadowColor ;
226
+
215
227
public override Widget build ( BuildContext context ) {
216
228
D . assert ( MaterialD . debugCheckHasMaterial ( context ) ) ;
217
229
return new RawChip (
@@ -230,6 +242,7 @@ public override Widget build(BuildContext context) {
230
242
padding : this . padding ,
231
243
materialTapTargetSize : this . materialTapTargetSize ,
232
244
elevation : this . elevation ,
245
+ shadowColor : this . shadowColor ,
233
246
isEnabled : true
234
247
) ;
235
248
}
@@ -265,6 +278,7 @@ public InputChip(
265
278
EdgeInsets padding = null ,
266
279
MaterialTapTargetSize ? materialTapTargetSize = null ,
267
280
float ? elevation = null ,
281
+ Color shadowColor = null ,
268
282
Color selectedShadowColor = null ,
269
283
ShapeBorder avatarBorder = null
270
284
) : base ( key : key ) {
@@ -294,6 +308,8 @@ public InputChip(
294
308
this . _padding = padding ;
295
309
this . _materialTapTargetSize = materialTapTargetSize ;
296
310
this . _elevation = elevation ;
311
+ this . _shadowColor = shadowColor ;
312
+ this . _selectedShadowColor = selectedShadowColor ;
297
313
}
298
314
299
315
public Widget avatar {
@@ -428,6 +444,18 @@ public float? elevation {
428
444
429
445
float ? _elevation ;
430
446
447
+ public Color shadowColor {
448
+ get { return this . _shadowColor ; }
449
+ }
450
+
451
+ Color _shadowColor ;
452
+
453
+ public Color selectedShadowColor {
454
+ get { return this . _selectedShadowColor ; }
455
+ }
456
+
457
+ Color _selectedShadowColor ;
458
+
431
459
public ShapeBorder avatarBorder {
432
460
get { return this . _avatarBorder ; }
433
461
}
@@ -459,6 +487,8 @@ public override Widget build(BuildContext context) {
459
487
padding : this . padding ,
460
488
materialTapTargetSize : this . materialTapTargetSize ,
461
489
elevation : this . elevation ,
490
+ shadowColor : this . shadowColor ,
491
+ selectedShadowColor : this . selectedShadowColor ,
462
492
isEnabled : this . isEnabled == true &&
463
493
( this . onSelected != null || this . onDeleted != null || this . onPressed != null ) ,
464
494
avatarBorder : this . avatarBorder
@@ -488,6 +518,8 @@ public ChoiceChip(
488
518
EdgeInsets padding = null ,
489
519
MaterialTapTargetSize ? materialTapTargetSize = null ,
490
520
float ? elevation = null ,
521
+ Color shadowColor = null ,
522
+ Color selectedShadowColor = null ,
491
523
ShapeBorder avatarBorder = null
492
524
) : base ( key : key ) {
493
525
D . assert ( selected != null ) ;
@@ -511,6 +543,8 @@ public ChoiceChip(
511
543
this . _padding = padding ;
512
544
this . _materialTapTargetSize = materialTapTargetSize ;
513
545
this . _elevation = elevation ;
546
+ this . _shadowColor = shadowColor ;
547
+ this . _selectedShadowColor = selectedShadowColor ;
514
548
}
515
549
516
550
public Widget avatar {
@@ -609,6 +643,18 @@ public float? elevation {
609
643
610
644
float ? _elevation ;
611
645
646
+ public Color shadowColor {
647
+ get { return this . _shadowColor ; }
648
+ }
649
+
650
+ Color _shadowColor ;
651
+
652
+ public Color selectedShadowColor {
653
+ get { return this . _selectedShadowColor ; }
654
+ }
655
+
656
+ Color _selectedShadowColor ;
657
+
612
658
public ShapeBorder avatarBorder {
613
659
get { return this . _avatarBorder ; }
614
660
}
@@ -642,6 +688,8 @@ public override Widget build(BuildContext context) {
642
688
isEnabled : this . isEnabled ,
643
689
materialTapTargetSize : this . materialTapTargetSize ,
644
690
elevation : this . elevation ,
691
+ shadowColor : this . shadowColor ,
692
+ selectedShadowColor : this . selectedShadowColor ,
645
693
avatarBorder : this . avatarBorder
646
694
) ;
647
695
}
@@ -669,6 +717,8 @@ public FilterChip(
669
717
EdgeInsets padding = null ,
670
718
MaterialTapTargetSize ? materialTapTargetSize = null ,
671
719
float ? elevation = null ,
720
+ Color shadowColor = null ,
721
+ Color selectedShadowColor = null ,
672
722
ShapeBorder avatarBorder = null
673
723
) : base ( key : key ) {
674
724
D . assert ( label != null ) ;
@@ -691,6 +741,8 @@ public FilterChip(
691
741
this . _padding = padding ;
692
742
this . _materialTapTargetSize = materialTapTargetSize ;
693
743
this . _elevation = elevation ;
744
+ this . _shadowColor = shadowColor ;
745
+ this . _selectedShadowColor = selectedShadowColor ;
694
746
}
695
747
696
748
public Widget avatar {
@@ -789,6 +841,18 @@ public float? elevation {
789
841
790
842
float ? _elevation ;
791
843
844
+ public Color shadowColor {
845
+ get { return this . _shadowColor ; }
846
+ }
847
+
848
+ Color _shadowColor ;
849
+
850
+ public Color selectedShadowColor {
851
+ get { return this . _selectedShadowColor ; }
852
+ }
853
+
854
+ Color _selectedShadowColor ;
855
+
792
856
public ShapeBorder avatarBorder {
793
857
get { return this . _avatarBorder ; }
794
858
}
@@ -819,6 +883,8 @@ public override Widget build(BuildContext context) {
819
883
isEnabled : this . isEnabled ,
820
884
materialTapTargetSize : this . materialTapTargetSize ,
821
885
elevation : this . elevation ,
886
+ shadowColor : this . shadowColor ,
887
+ selectedShadowColor : this . selectedShadowColor ,
822
888
avatarBorder : this . avatarBorder
823
889
) ;
824
890
}
@@ -839,7 +905,8 @@ public ActionChip(
839
905
Color backgroundColor = null ,
840
906
EdgeInsets padding = null ,
841
907
MaterialTapTargetSize ? materialTapTargetSize = null ,
842
- float ? elevation = null
908
+ float ? elevation = null ,
909
+ Color shadowColor = null
843
910
) : base ( key : key ) {
844
911
D . assert ( label != null ) ;
845
912
D . assert (
@@ -862,6 +929,7 @@ public ActionChip(
862
929
this . _padding = padding ;
863
930
this . _materialTapTargetSize = materialTapTargetSize ;
864
931
this . _elevation = elevation ;
932
+ this . _shadowColor = shadowColor ;
865
933
}
866
934
867
935
@@ -943,6 +1011,12 @@ public float? elevation {
943
1011
944
1012
float ? _elevation ;
945
1013
1014
+ public Color shadowColor {
1015
+ get { return this . _shadowColor ; }
1016
+ }
1017
+
1018
+ Color _shadowColor ;
1019
+
946
1020
public override Widget build ( BuildContext context ) {
947
1021
D . assert ( MaterialD . debugCheckHasMaterial ( context ) ) ;
948
1022
return new RawChip (
@@ -959,7 +1033,8 @@ public override Widget build(BuildContext context) {
959
1033
labelPadding : this . labelPadding ,
960
1034
isEnabled : true ,
961
1035
materialTapTargetSize : this . materialTapTargetSize ,
962
- elevation : this . elevation
1036
+ elevation : this . elevation ,
1037
+ shadowColor : this . _shadowColor
963
1038
) ;
964
1039
}
965
1040
}
@@ -996,6 +1071,8 @@ public RawChip(
996
1071
Color backgroundColor = null ,
997
1072
MaterialTapTargetSize ? materialTapTargetSize = null ,
998
1073
float ? elevation = null ,
1074
+ Color shadowColor = null ,
1075
+ Color selectedShadowColor = null ,
999
1076
ShapeBorder avatarBorder = null
1000
1077
) : base ( key : key ) {
1001
1078
D . assert ( label != null ) ;
@@ -1028,6 +1105,8 @@ public RawChip(
1028
1105
this . _backgroundColor = backgroundColor ;
1029
1106
this . _materialTapTargetSize = materialTapTargetSize ;
1030
1107
this . _elevation = elevation ;
1108
+ this . _shadowColor = shadowColor ;
1109
+ this . _selectedShadowColor = selectedShadowColor ;
1031
1110
}
1032
1111
1033
1112
@@ -1163,6 +1242,18 @@ public float? elevation {
1163
1242
1164
1243
float ? _elevation ;
1165
1244
1245
+ public Color shadowColor {
1246
+ get { return this . _shadowColor ; }
1247
+ }
1248
+
1249
+ Color _shadowColor ;
1250
+
1251
+ public Color selectedShadowColor {
1252
+ get { return this . _selectedShadowColor ; }
1253
+ }
1254
+
1255
+ Color _selectedShadowColor ;
1256
+
1166
1257
public ShapeBorder avatarBorder {
1167
1258
get { return this . _avatarBorder ; }
1168
1259
}
@@ -1426,16 +1517,21 @@ public override Widget build(BuildContext context) {
1426
1517
ShapeBorder shape = this . widget . shape ?? chipTheme . shape ;
1427
1518
float elevation = this . widget . elevation ?? ( chipTheme . elevation ?? _defaultElevation ) ;
1428
1519
float pressElevation = this . widget . pressElevation ?? ( chipTheme . pressElevation ?? _defaultPressElevation ) ;
1520
+ Color shadowColor = this . widget . shadowColor ?? chipTheme . shadowColor ?? _defaultShadowColor ;
1521
+ Color selectedShadowColor = this . widget . selectedShadowColor ?? chipTheme . selectedShadowColor ?? _defaultShadowColor ;
1522
+ bool selected = this . widget . selected ?? false ;
1429
1523
1430
1524
Widget result = new Material (
1431
1525
elevation : this . isTapping ? pressElevation : elevation ,
1526
+ shadowColor : selected ? selectedShadowColor : shadowColor ,
1432
1527
animationDuration : pressedAnimationDuration ,
1433
1528
shape : shape ,
1434
1529
clipBehavior : this . widget . clipBehavior ,
1435
- child : new InkResponse (
1530
+ child : new InkWell (
1436
1531
onTap : this . canTap ? this . _handleTap : ( GestureTapCallback ) null ,
1437
1532
onTapDown : this . canTap ? this . _handleTapDown : ( GestureTapDownCallback ) null ,
1438
- onTapCancel : this . canTap ? this . _handleTapCancel : ( GestureTapCallback ) null ,
1533
+ onTapCancel : this . canTap ? this . _handleTapCancel : ( GestureTapCancelCallback ) null ,
1534
+ customBorder : shape ,
1439
1535
child : new AnimatedBuilder (
1440
1536
animation : ListenableUtils . merge ( new List < Listenable >
1441
1537
{ this . selectController , this . enableController } ) ,
0 commit comments