Repository: flutter
Issue: Repeated scale animation doesn't work when Transform.scale wraps opacity.
Labels: framework,a: animation,has reproducible steps,P2,team-framework,triaged-framework,found in release: 3.22,found in release: 3.24

### Steps to reproduce

1. Use flutter beta
2. Paste the code
3. Tap the square, animation works as expected
4. Tap the square again, scale doesn't work, only opacity works.

### Expected results

Scale should work on subsequent animation calls, not only for the first time.

### Actual results

The Scale animation doesn't work when called more than once, while the Opacity animation does. After a hot reload, only the last frame of the Scale animation is rendered. Interestingly, if we swap the Opacity widget with a Transform.scale widget, everything works as expected (when Opacity wraps Transform.scale, instead of Transform.scale wrapping Opacity).

### Code sample

<details open><summary>Code sample</summary>

```dart
class TestAnimation extends StatefulWidget {
  const TestAnimation({super.key});

  @override
  State<TestAnimation> createState() => _TestAnimationState();
}

class _TestAnimationState extends State<TestAnimation>
    with SingleTickerProviderStateMixin {
  late final AnimationController _controller;

  Animation<double> _scale = const AlwaysStoppedAnimation(0);
  Animation<double> _opacity = const AlwaysStoppedAnimation(0);

  @override
  void initState() {
    super.initState();
    _controller = AnimationController(
      vsync: this,
      duration: const Duration(seconds: 2),
    );
    _controller.addListener(() => setState(() {}));
  }

  @override
  void dispose() {
    _controller.dispose();
    super.dispose();
  }

  TickerFuture _animate() {
    _scale = _controller.drive(
      Tween<double>(
        begin: 0,
        end: 1.5,
      ),
    );

    _opacity = _controller.drive(
      Tween<double>(
        begin: 0,
        end: 1,
      ),
    );

    return _controller.forward(from: 0);
  }

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      behavior: HitTestBehavior.translucent,
      onTap: _animate,
      child: DecoratedBox(
        decoration: BoxDecoration(
          border: Border.all(
            width: 2,
            color: Colors.green,
          ),
        ),
        child: Transform.scale(
          scale: _scale.value,
          child: Opacity(
            opacity: _opacity.value,
            child: Container(
              width: 50,
              height: 50,
              color: Colors.red,
            ),
          ),
        ),
      ),
    );
  }
}
```

</details>


### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>


https://github.com/user-attachments/assets/275aa634-bcb2-4f50-9caf-358b54056092



</details>


### Logs

<details open><summary>Logs</summary>

```console
[Paste your logs here]
```

</details>


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, 3.23.0-0.1.pre, on macOS 14.5 23F79 darwin-arm64,
    locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] VS Code (version 1.90.2)
[✓] Connected device (5 available)
[✓] Network resources

• No issues found!
```

</details>