Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
c00e9798
Unverified
Commit
c00e9798
authored
Sep 22, 2023
by
Polina Cherkasova
Committed by
GitHub
Sep 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix _paintAvatar in chip.dart to dispose layer. (#135228)
parent
a4e3f933
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
chip.dart
packages/flutter/lib/src/material/chip.dart
+9
-3
No files found.
packages/flutter/lib/src/material/chip.dart
View file @
c00e9798
...
...
@@ -2065,21 +2065,26 @@ class _RenderChip extends RenderBox with SlottedContainerRenderObjectMixin<_Chip
}
}
final
LayerHandle
<
OpacityLayer
>
_childOpacityLayerHandler
=
LayerHandle
<
OpacityLayer
>();
void
_paintChild
(
PaintingContext
context
,
Offset
offset
,
RenderBox
?
child
,
bool
?
isEnabled
)
{
if
(
child
==
null
)
{
_childOpacityLayerHandler
.
layer
=
null
;
return
;
}
final
int
disabledColorAlpha
=
_disabledColor
.
alpha
;
if
(!
enableAnimation
.
isCompleted
)
{
if
(
needsCompositing
)
{
context
.
pushLayer
(
OpacityLayer
(
alpha:
disabledColorAlpha
),
_childOpacityLayerHandler
.
layer
=
context
.
pushOpacity
(
offset
,
disabledColorAlpha
,
(
PaintingContext
context
,
Offset
offset
)
{
context
.
paintChild
(
child
,
_boxParentData
(
child
).
offset
+
offset
);
},
o
ffset
,
o
ldLayer:
_childOpacityLayerHandler
.
layer
,
);
}
else
{
_childOpacityLayerHandler
.
layer
=
null
;
final
Rect
childRect
=
_boxRect
(
child
).
shift
(
offset
);
context
.
canvas
.
saveLayer
(
childRect
.
inflate
(
20.0
),
Paint
()..
color
=
_disabledColor
);
context
.
paintChild
(
child
,
_boxParentData
(
child
).
offset
+
offset
);
...
...
@@ -2092,6 +2097,7 @@ class _RenderChip extends RenderBox with SlottedContainerRenderObjectMixin<_Chip
@override
void
dispose
()
{
_childOpacityLayerHandler
.
layer
=
null
;
_avatarOpacityLayerHandler
.
layer
=
null
;
super
.
dispose
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment