File tree Expand file tree Collapse file tree
packages/flutter/lib/src/material Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2065,21 +2065,26 @@ class _RenderChip extends RenderBox with SlottedContainerRenderObjectMixin<_Chip
20652065 }
20662066 }
20672067
2068+ final LayerHandle <OpacityLayer > _childOpacityLayerHandler = LayerHandle <OpacityLayer >();
2069+
20682070 void _paintChild (PaintingContext context, Offset offset, RenderBox ? child, bool ? isEnabled) {
20692071 if (child == null ) {
2072+ _childOpacityLayerHandler.layer = null ;
20702073 return ;
20712074 }
20722075 final int disabledColorAlpha = _disabledColor.alpha;
20732076 if (! enableAnimation.isCompleted) {
20742077 if (needsCompositing) {
2075- context.pushLayer (
2076- OpacityLayer (alpha: disabledColorAlpha),
2078+ _childOpacityLayerHandler.layer = context.pushOpacity (
2079+ offset,
2080+ disabledColorAlpha,
20772081 (PaintingContext context, Offset offset) {
20782082 context.paintChild (child, _boxParentData (child).offset + offset);
20792083 },
2080- offset ,
2084+ oldLayer : _childOpacityLayerHandler.layer ,
20812085 );
20822086 } else {
2087+ _childOpacityLayerHandler.layer = null ;
20832088 final Rect childRect = _boxRect (child).shift (offset);
20842089 context.canvas.saveLayer (childRect.inflate (20.0 ), Paint ()..color = _disabledColor);
20852090 context.paintChild (child, _boxParentData (child).offset + offset);
@@ -2092,6 +2097,7 @@ class _RenderChip extends RenderBox with SlottedContainerRenderObjectMixin<_Chip
20922097
20932098 @override
20942099 void dispose () {
2100+ _childOpacityLayerHandler.layer = null ;
20952101 _avatarOpacityLayerHandler.layer = null ;
20962102 super .dispose ();
20972103 }
You can’t perform that action at this time.
0 commit comments