mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Fix memory leak in ExpansionTile. (#147596)
This commit is contained in:
parent
eeb351ce4b
commit
145e94018c
@ -613,6 +613,7 @@ class _ExpansionTileState extends State<ExpansionTile> with SingleTickerProvider
|
||||
void dispose() {
|
||||
_tileController._state = null;
|
||||
_animationController.dispose();
|
||||
_heightFactor.dispose();
|
||||
_timer?.cancel();
|
||||
_timer = null;
|
||||
super.dispose();
|
||||
|
||||
@ -11,6 +11,7 @@ import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart';
|
||||
|
||||
class TestIcon extends StatefulWidget {
|
||||
const TestIcon({super.key});
|
||||
@ -222,7 +223,10 @@ void main() {
|
||||
expect(iconColor(collapsedIconKey), foregroundColor);
|
||||
}, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }));
|
||||
|
||||
testWidgets('ExpansionTile subtitle', (WidgetTester tester) async {
|
||||
testWidgets('ExpansionTile subtitle',
|
||||
// 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(
|
||||
const MaterialApp(
|
||||
home: Scaffold(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user