Skip to content

[material_ui] Dispose drag-end CurvedAnimation in modal bottom sheet - #13167

Merged
auto-submit[bot] merged 2 commits into
flutter:mainfrom
NikhilKukreja26:fix-modal-bottom-sheet-animation-leak
Nov 6, 2026
Merged

auto-submit[bot] merged 2 commits into
flutter:mainfrom
NikhilKukreja26:fix-modal-bottom-sheet-animation-leak

Conversation

@NikhilKukreja26

@NikhilKukreja26 NikhilKukreja26 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Fixes flutter/flutter#193944

_ModalBottomSheetState.handleDragEnd rebinds the sheet animation to a new
CurvedAnimation on every drag end but never disposed the previous one, so its
listeners accumulated on the route animation. This tracks the drag-end
CurvedAnimation and disposes it in handleDragStart, when it is replaced, and
in dispose. Adds a regression test that fails before the fix.

Pre-Review Checklist

@github-actions github-actions Bot added p: material_ui triage-design Should be looked at in design triage labels Oct 8, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Piinks

Piinks commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Can you complete the checklist before we review this? Thanks!

@NikhilKukreja26

NikhilKukreja26 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Can you complete the checklist before we review this? Thanks!

I have updated the checklist.

@elliette elliette added the CICD Run CI/CD label Nov 4, 2026

@QuncCccccc QuncCccccc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you for your contribution!

@elliette elliette left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@elliette elliette added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 6, 2026
@auto-submit
auto-submit Bot merged commit 62099ac into flutter:main Nov 6, 2026
14 checks passed
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD p: material_ui triage-design Should be looked at in design triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[material_ui] Modal bottom sheets retain obsolete CurvedAnimation status listeners after drags

4 participants