Unverified Commit 5d5da388 authored by Kostia Sokolovskyi's avatar Kostia Sokolovskyi Committed by GitHub

Fix memory leak in _DraggableScrollableSheetState (#134212)

parent 834f5dc2
......@@ -718,7 +718,11 @@ class _DraggableScrollableSheetState extends State<DraggableScrollableSheet> {
@override
void dispose() {
widget.controller?._detach(disposeExtent: true);
if (widget.controller == null) {
_extent.dispose();
} else {
widget.controller!._detach(disposeExtent: true);
}
_scrollController.dispose();
super.dispose();
}
......
......@@ -1590,12 +1590,7 @@ void main() {
expect(titleOffset, const Offset(292.0, 136.0));
expect(titleOffset.dx, lessThan(wideSize.width - 320)); // Default master view width is 320.0.
expect(tester.getCenter(find.byType(ListView)), const Offset(160, 356));
},
leakTrackingTestConfig: const LeakTrackingTestConfig(
// TODO(polina-c): remove after fixing
// https://github.com/flutter/flutter/issues/133705
notDisposedAllowList: <String, int?> {'ValueNotifier<double>':5},
));
});
testWidgets('Material2 - LicensePage master view layout position - rtl', (WidgetTester tester) async {
const TextDirection textDirection = TextDirection.rtl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment