@@ -681,10 +681,7 @@ public FilterChip(
681
681
float ? elevation = null ,
682
682
ShapeBorder avatarBorder = null
683
683
) : base ( key : key ) {
684
- D . assert ( selected != null ) ;
685
- D . assert ( onSelected != null ) ;
686
684
D . assert ( label != null ) ;
687
- D . assert ( clipBehavior != null ) ;
688
685
D . assert ( pressElevation == null || pressElevation >= 0.0f ) ;
689
686
D . assert ( elevation == null || elevation >= 0.0f ) ;
690
687
this . _avatarBorder = avatarBorder ?? new CircleBorder ( ) ;
@@ -1013,7 +1010,6 @@ public RawChip(
1013
1010
) : base ( key : key ) {
1014
1011
D . assert ( label != null ) ;
1015
1012
D . assert ( isEnabled != null ) ;
1016
- D . assert ( clipBehavior != null ) ;
1017
1013
D . assert ( pressElevation == null || pressElevation >= 0.0f ) ;
1018
1014
D . assert ( elevation == null || elevation >= 0.0f ) ;
1019
1015
deleteIcon = deleteIcon ?? ChipUtils . _kDefaultDeleteIcon ;
@@ -1438,8 +1434,8 @@ public override Widget build(BuildContext context) {
1438
1434
ChipThemeData chipTheme = ChipTheme . of ( context ) ;
1439
1435
TextDirection textDirection = Directionality . of ( context ) ;
1440
1436
ShapeBorder shape = this . widget . shape ?? chipTheme . shape ;
1441
- float elevation = this . widget . elevation ?? chipTheme . elevation ?? _defaultElevation ;
1442
- float pressElevation = this . widget . pressElevation ?? chipTheme . pressElevation ?? _defaultPressElevation ;
1437
+ float elevation = this . widget . elevation ?? ( chipTheme . elevation ?? _defaultElevation ) ;
1438
+ float pressElevation = this . widget . pressElevation ?? ( chipTheme . pressElevation ?? _defaultPressElevation ) ;
1443
1439
1444
1440
Widget result = new Material (
1445
1441
elevation : this . isTapping ? pressElevation : elevation ,
@@ -1503,7 +1499,7 @@ public override Widget build(BuildContext context) {
1503
1499
)
1504
1500
) ;
1505
1501
BoxConstraints constraints ;
1506
- switch ( this . widget . materialTapTargetSize ) {
1502
+ switch ( this . widget . materialTapTargetSize ?? theme . materialTapTargetSize ) {
1507
1503
case MaterialTapTargetSize . padded :
1508
1504
constraints = new BoxConstraints ( minHeight : 48.0f ) ;
1509
1505
break ;
@@ -1657,7 +1653,7 @@ protected override void forgetChild(Element child) {
1657
1653
}
1658
1654
1659
1655
void _mountChild ( Widget widget , _ChipSlot slot ) {
1660
- Element oldChild = this . slotToChild [ slot ] ;
1656
+ Element oldChild = this . slotToChild . getOrDefault ( slot ) ;
1661
1657
Element newChild = this . updateChild ( oldChild , widget , slot ) ;
1662
1658
if ( oldChild != null ) {
1663
1659
this . slotToChild . Remove ( slot ) ;
@@ -1714,10 +1710,10 @@ void _updateRenderObject(RenderObject child, _ChipSlot slot) {
1714
1710
}
1715
1711
}
1716
1712
1717
- protected override void insertChildRenderObject ( RenderObject child , dynamic slotValue ) {
1713
+ protected override void insertChildRenderObject ( RenderObject child , object slotValue ) {
1718
1714
D . assert ( child is RenderBox ) ;
1719
1715
D . assert ( slotValue is _ChipSlot ) ;
1720
- _ChipSlot slot = slotValue ;
1716
+ _ChipSlot slot = ( _ChipSlot ) slotValue ;
1721
1717
this . _updateRenderObject ( child , slot ) ;
1722
1718
D . assert ( this . renderObject . childToSlot . ContainsKey ( ( RenderBox ) child ) ) ;
1723
1719
D . assert ( this . renderObject . slotToChild . ContainsKey ( slot ) ) ;
@@ -1731,7 +1727,7 @@ protected override void removeChildRenderObject(RenderObject child) {
1731
1727
D . assert ( ! this . renderObject . slotToChild . ContainsKey ( ( _ChipSlot ) this . slot ) ) ;
1732
1728
}
1733
1729
1734
- protected override void moveChildRenderObject ( RenderObject child , dynamic slotValue ) {
1730
+ protected override void moveChildRenderObject ( RenderObject child , object slotValue ) {
1735
1731
D . assert ( false , "not reachable" ) ;
1736
1732
}
1737
1733
}
@@ -1798,11 +1794,11 @@ public bool Equals(_ChipRenderTheme other) {
1798
1794
}
1799
1795
1800
1796
public static bool operator == ( _ChipRenderTheme left , _ChipRenderTheme right ) {
1801
- return left . Equals ( right ) ;
1797
+ return Equals ( left , right ) ;
1802
1798
}
1803
1799
1804
1800
public static bool operator != ( _ChipRenderTheme left , _ChipRenderTheme right ) {
1805
- return ! left . Equals ( right ) ;
1801
+ return ! Equals ( left , right ) ;
1806
1802
}
1807
1803
1808
1804
public override int GetHashCode ( ) {
@@ -1832,9 +1828,9 @@ public _RenderChip(
1832
1828
) {
1833
1829
D . assert ( theme != null ) ;
1834
1830
this . _theme = theme ;
1835
- this . checkmarkAnimation . addListener ( this . markNeedsPaint ) ;
1831
+ checkmarkAnimation . addListener ( this . markNeedsPaint ) ;
1836
1832
avatarDrawerAnimation . addListener ( this . markNeedsLayout ) ;
1837
- this . deleteDrawerAnimation . addListener ( this . markNeedsLayout ) ;
1833
+ deleteDrawerAnimation . addListener ( this . markNeedsLayout ) ;
1838
1834
enableAnimation . addListener ( this . markNeedsPaint ) ;
1839
1835
this . value = value ;
1840
1836
this . isEnabled = isEnabled ;
@@ -2141,11 +2137,10 @@ protected override void performLayout() {
2141
2137
2142
2138
2143
2139
const float left = 0.0f ;
2144
- float right = overallSize . width ;
2145
2140
2146
2141
Offset centerLayout ( Size boxSize , float x ) {
2147
2142
D . assert ( contentSize >= boxSize . height ) ;
2148
- return new Offset ( x - boxSize . width , ( contentSize - boxSize . height ) / 2.0f ) ;
2143
+ return new Offset ( x , ( contentSize - boxSize . height ) / 2.0f ) ;
2149
2144
}
2150
2145
2151
2146
Offset avatarOffset = Offset . zero ;
@@ -2202,11 +2197,11 @@ Offset centerLayout(Size boxSize, float x) {
2202
2197
) ;
2203
2198
this . size = this . constraints . constrain ( paddedSize ) ;
2204
2199
D . assert ( this . size . height == this . constraints . constrainHeight ( paddedSize . height ) ,
2205
- "Constrained height ${ size.height} doesn't match expected height " +
2206
- "${ constraints.constrainWidth(paddedSize.height)}") ;
2200
+ $ "Constrained height { this . size . height } doesn't match expected height " +
2201
+ $ " { this . constraints . constrainWidth ( paddedSize . height ) } ") ;
2207
2202
D . assert ( this . size . width == this . constraints . constrainWidth ( paddedSize . width ) ,
2208
- "Constrained width ${ size.width} doesn't match expected width " +
2209
- "${ constraints.constrainWidth(paddedSize.width)}") ;
2203
+ $ "Constrained width { this . size . width } doesn't match expected width " +
2204
+ $ " { this . constraints . constrainWidth ( paddedSize . width ) } ") ;
2210
2205
}
2211
2206
2212
2207
static ColorTween selectionScrimTween = new ColorTween (
0 commit comments