SegmentedButton should not create new MaterialStatesController in every build.#133949
SegmentedButton should not create new MaterialStatesController in every build.#133949polina-c merged 3 commits intoflutter:masterfrom
Conversation
|
Shouldn't we be trying to dispose controllers for segments that no longer exist? |
Yes, this may great next improvement for the code. I am not familiar with code enough to implement it. Can you create it? |
|
Unfortunately this PR prevents a source of unnecessary allocations but creates a leak (#133949 (comment)). I suppose what needs to be done is to diff the old and new lists of segments in a https://api.flutter.dev/flutter/widgets/State/didUpdateWidget.html override and dispose the discarded segments. |
Thanks. I will prepare update: #134061 |
|
Fix: #134064 |
No description provided.