Skip to content

Commit 47a4c69

Browse files
Dispose the curved animation in transition test (flutter#146961)
1 parent a6c7f90 commit 47a4c69

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/flutter/test/widgets/transitions_test.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,13 @@ void main() {
100100
// TODO(polina-c): remove when fixed https://github.com/flutter/flutter/issues/145600 [leak-tracking-opt-in]
101101
experimentalLeakTesting: LeakTesting.settings.withTracked(classes: const <String>['CurvedAnimation']),
102102
(WidgetTester tester) async {
103-
final Animation<Decoration> curvedDecorationAnimation =
104-
decorationTween.animate(CurvedAnimation(
103+
final CurvedAnimation curvedAnimation = CurvedAnimation(
105104
parent: controller,
106105
curve: Curves.easeOut,
107-
));
106+
);
107+
addTearDown(curvedAnimation.dispose);
108+
final Animation<Decoration> curvedDecorationAnimation =
109+
decorationTween.animate(curvedAnimation);
108110

109111
final DecoratedBoxTransition transitionUnderTest = DecoratedBoxTransition(
110112
decoration: curvedDecorationAnimation,

0 commit comments

Comments
 (0)