Repository: flutter
Issue: CurvedAnimation leaks in flutter framework
Labels: a: tests,framework,a: animation,P2,team-framework,triaged-framework,a: leak tracking

### Steps to reproduce

Run the below tests with leak_tracker_flutter_testing configured https://github.com/dart-lang/leak_tracker/blob/main/doc/leak_tracking/DETECT.md#test-cover-with-testwidgets
 
### Expected results

Animations a disposed properly

### Actual results

Leak tracker detects leaks

### Code sample

<details open><summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

class SimpleButtonPage extends StatefulWidget {
  const SimpleButtonPage({super.key});

  @override
  _SimpleButtonPageState createState() => _SimpleButtonPageState();
}

class _SimpleButtonPageState extends State<SimpleButtonPage> {
  int counter = 0;

  void incrementCounter() {
    setState(() {
      counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Simple Button Test'),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            const Text('You have pushed the button this many times:'),
            Text(
              '$counter',
            ),
            ElevatedButton(
              onPressed: incrementCounter,
              child: const Text('Increment'),
            ),
          ],
        ),
      ),
    );
  }
}

void main() {
  testWidgets('Button click increases counter', (WidgetTester tester) async {
    await tester.pumpWidget(const MaterialApp(home: SimpleButtonPage()));

    expect(find.text('You have pushed the button this many times:'), findsOneWidget);
    expect(find.text('0'), findsOneWidget);


    await tester.tap(find.byType(ElevatedButton));
    await tester.pump();

    expect(find.text('1'), findsOneWidget);
  });
}

```

</details>


### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>

[Upload media here]

</details>


### Logs

<details open><summary>Logs</summary>

```console
notDisposed:
              total: 3
              objects:
                CurvedAnimation:
                  test: Button click increases counter
                  identityHashCode: 445682550
                CurvedAnimation:
                  test: Button click increases counter
                  identityHashCode: 340990049
                CurvedAnimation:
                  test: Button click increases counter
                  identityHashCode: 36430547
```

</details>


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.22.2, on macOS 14.5 23F79 darwin-arm64, locale en-NG)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.1)
[✓] IntelliJ IDEA Ultimate Edition (version 2024.1.3)
[✓] VS Code (version 1.89.0)
[✓] Connected device (4 available)

```

</details>