Repository navigation
feat(ensemble_widget): manage shared controller bindings and improve listener cleanup - #2377
Merged
Merged
Conversation
usmanvrtx
force-pushed
the
fix/unclosed-listeners-tv
branch
from
September 28, 2026 00:25
9db9546 to
0789d5d
Compare
usmanvrtx
force-pushed
the
fix/unclosed-listeners-tv
branch
from
September 28, 2026 15:34
70420e5 to
9d0a655
Compare
Member
There was a problem hiding this comment.
The PR description mentions test/ensemble_widget_rebind_test.dart, but that test file is not currently part of the diff.
At minimum I’d like tests covering:
- two mounted widgets sharing one controller;
- disposing one owner keeps the binding alive;
- disposing the final owner removes the listener;
- disposed/cached widget remount restores exactly one subscription;
- controller replacement;
- scope A → scope B movement;
- two sibling child scopes sharing the same PageData;
- repeated dialog/bottom-sheet open/close does not grow listenerMap;
- page disposal clears registrations/owners/listeners.
Given this code sits in the core binding lifecycle, I’d treat those as required regression tests rather than relying on manual verification.
sharjeelyunus
approved these changes
Sep 29, 2026
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.
Description
This PR fixes binding listener leaks and lost subscriptions when widgets are rebuilt, moved between scopes, or temporarily disposed and remounted.
It also ensures that child scopes do not tear down page-owned resources, while page disposal cancels and clears subscriptions, timers, and other page-owned references.
Related Issue
N/A
Type of Change
What Has Changed
How to Test
flutter testScreenshots / Videos
Not applicable.
Checklist
flutter analyzeand addressed any new warningsflutter testand all tests pass