Repository navigation
[material_ui] Dispose drag-end CurvedAnimation in modal bottom sheet - #13167
Merged
auto-submit[bot] merged 2 commits intoNov 6, 2026
Merged
auto-submit[bot] merged 2 commits into
auto-submit[bot] merged 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request addresses a memory leak in modal bottom sheets by tracking and disposing of the CurvedAnimation created during drag-end events, accompanied by a regression test. The review feedback suggests a safer disposal sequence in handleDragEnd to ensure the old animation is detached from _sheetAnimation before being disposed, preventing issues with active listeners.
Contributor
Can you complete the checklist before we review this? Thanks! |
Contributor
Author
I have updated the checklist. |
QuncCccccc
approved these changes
Nov 6, 2026
QuncCccccc
left a comment
Contributor
There was a problem hiding this comment.
LGTM! Thank you for your contribution!
QuncCccccc
force-pushed
the
fix-modal-bottom-sheet-animation-leak
branch
from
November 6, 2026 00:34
60aeb71 to
ad15177
Compare
definev
pushed a commit
to definev/flutter
that referenced
this pull request
Nov 9, 2026
…6210) flutter/packages@63881f9...565c657 2026-11-08 [email protected] Roll Flutter from e36b370 to acade0f (1 revision) (flutter/packages#13590) 2026-11-07 [email protected] [material_ui] Fix DropdownMenu losing text cursor when re-enabled (flutter/packages#13179) 2026-11-07 [email protected] Roll Flutter from 09175cd to e36b370 (22 revisions) (flutter/packages#13586) 2026-11-07 [email protected] [material_ui] Add Material motion springs (flutter/packages#13338) 2026-11-06 [email protected] [material_ui] Paint the active RoundedRectSliderTrackShape segment on top in RTL (flutter/packages#13225) 2026-11-06 [email protected] [pigeon] Replace Experimental with Preview (flutter/packages#13579) 2026-11-06 [email protected] [material_ui] Fix minimum width for Material 3 primary tab indicator (flutter/packages#13322) 2026-11-06 [email protected] [material_ui] Dispose drag-end CurvedAnimation in modal bottom sheet (flutter/packages#13167) 2026-11-06 [email protected] [camera_web] Re: Support for camera stream on web (flutter/packages#7950) 2026-11-06 [email protected] Roll Flutter from 3623d2d to 09175cd (61 revisions) (flutter/packages#13578) If this roll has caused a breakage, revert this CL and set the roller to dry run mode using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes flutter/flutter#193944
_ModalBottomSheetState.handleDragEndrebinds the sheet animation to a newCurvedAnimationon every drag end but never disposed the previous one, so itslisteners accumulated on the route animation. This tracks the drag-end
CurvedAnimationand disposes it inhandleDragStart, when it is replaced, andin
dispose. Adds a regression test that fails before the fix.Pre-Review Checklist
[shared_preferences]///).