mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Fix memory leak in BottomNavigationBar
(#146748)
This commit is contained in:
parent
cb719db814
commit
c3445dc190
@ -883,6 +883,9 @@ class _BottomNavigationBarState extends State<BottomNavigationBar> with TickerPr
|
||||
for (final _Circle circle in _circles) {
|
||||
circle.dispose();
|
||||
}
|
||||
for (final CurvedAnimation animation in _animations) {
|
||||
animation.dispose();
|
||||
}
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,7 @@ import 'dart:ui';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart';
|
||||
|
||||
import '../widgets/semantics_tester.dart';
|
||||
|
||||
@ -1282,7 +1283,10 @@ void main() {
|
||||
await checkDragHandleAndColors();
|
||||
});
|
||||
|
||||
testWidgets('showModalBottomSheet does not use root Navigator by default', (WidgetTester tester) async {
|
||||
testWidgets('showModalBottomSheet does not use root Navigator by default',
|
||||
// TODO(polina-c): remove when fixed https://github.com/flutter/flutter/issues/145600 [leak-tracking-opt-in]
|
||||
experimentalLeakTesting: LeakTesting.settings.withTracked(classes: const <String>['CurvedAnimation']),
|
||||
(WidgetTester tester) async {
|
||||
await tester.pumpWidget(MaterialApp(
|
||||
home: Scaffold(
|
||||
body: Navigator(onGenerateRoute: (RouteSettings settings) => MaterialPageRoute<void>(builder: (_) {
|
||||
|
Loading…
Reference in New Issue
Block a user