Fix IconButton leaks its internal MaterialStatesController (#130720)
## Description This PR adds a call to dispose the internal `MaterialStatesController` instantiated by `_SelectableIconButtonState`. I found this memory leak while working on M2/M3 test update for `about_test.dart`. This memory leak only happens when using M3 because `IconButton` relies on `_SelectableIconButton` only when useMaterial3 is true: https://github.com/flutter/flutter/blob/3a1190a5a85c3e6a0cf3a9c30f34548fdd48ac1e/packages/flutter/lib/src/material/icon_button.dart#L671-L721 ## Related Issue Fixes https://github.com/flutter/flutter/issues/130708 ## Tests Adds 1 test.
Showing
Please register or sign in to comment