Repository: flutter
Issue: Animation listener of Hero flightShuttleBuilder not triggered
Labels: framework,a: animation,f: routes,has reproducible steps,P2,found in release: 3.7,found in release: 3.10,team-framework,triaged-framework

I have a hero transition going on from one page to another. In the `flightShuttleBuilder`, I register a listener for the animation in order to trigger a `setState` after the animation completed. This works fine so far.
However, when first triggering the hero to move to the details page, then popping the route and while the hero animation is on-going, tapping the same source hero again to go back to the details page, then the animation listener does not receive the `completed` status.

Interestingly, when replacing the `InkWell` widget with a simple `GestureDetector`, the source widget can not be tapped while the transition is on-going, which would also be fine for me, since it at least prevents the bug from happening.
The whole way of abusing the `flightShuttleBuilder` just to know when the transition is finished feels a bit weird to me anyways, is there a cleaner way to achieve this?

This is how it looks like when not interrupting the transition, when the animation has been completed, the `setState` changes the color of the body to yellow:

![good](https://user-images.githubusercontent.com/3159451/77853465-8705ae00-71e4-11ea-9666-6a1828c49cde.gif)

And this how it looks like when the bug is happening, the animation finishes, but the color is not changed, because the listener is never triggered:

![bad](https://user-images.githubusercontent.com/3159451/77853466-89680800-71e4-11ea-9ecf-d0367be26429.gif)


Code:
```dart
import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      initialRoute: '/',
      routes: {
        '/': (context) => HomePage(),
        '/details': (context) => DetailsPage(),
      },
    );
  }
}

class HomePage extends StatefulWidget {
  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('title')),
      body: ListView.builder(
        padding: const EdgeInsets.all(40),
        itemCount: 2,
        itemBuilder: (context, index) {
          return InkWell(
            onTap: () async {
              await Navigator.of(context).pushNamed(
                '/details',
                arguments: index,
              );
            },
            child: Row(
              children: <Widget>[
                Padding(
                  padding: const EdgeInsets.all(10),
                  child: Hero(
                    tag: index,
                    child: Container(color: Colors.red, width: 80, height: 80),
                  ),
                ),
              ],
            ),
          );
        },
      ),
    );
  }
}

class DetailsPage extends StatefulWidget {
  @override
  _DetailsPageState createState() => _DetailsPageState();
}

class _DetailsPageState extends State<DetailsPage> {
  Color bodyColor = Colors.red;

  @override
  Widget build(BuildContext context) {
    final int index = ModalRoute.of(context).settings.arguments;
    return Scaffold(
      appBar: AppBar(title: Text('Details')),
      body: Column(
        children: [
          Hero(
            tag: index,
            flightShuttleBuilder: (_, animation, __, ___, ____) {
              animation.addStatusListener((status) {
                if (status == AnimationStatus.completed) {
                  WidgetsBinding.instance.scheduleFrameCallback((_) {
                    setState(() {
                      bodyColor = Colors.yellow;
                    });
                  });
                }
              });
              return Container(
                color: Colors.purple,
                width: 200,
                height: 200,
              );
            },
            child: Container(
              color: Colors.purple,
              width: 500,
              height: 300,
            ),
          ),
          Container(
            color: bodyColor,
            width: 200,
            height: 200,
          ),
        ],
      ),
    );
  }
}
```

Flutter doctor:
```
[✓] Flutter (Channel stable, v1.12.13+hotfix.8, on Linux, locale en_US)
    • Flutter version 1.12.13+hotfix.8 at /opt/flutter
    • Framework revision 0b8abb4724 (7 weeks ago), 2020-02-11 11:44:36 -0800
    • Engine revision e1e6ced81d
    • Dart version 2.7.0

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /home/developer/android-sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.2
    • ANDROID_HOME = /home/developer/android-sdk
    • ANDROID_SDK_ROOT = /home/developer/android-sdk
    • Java binary at: /opt/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[✓] Android Studio (version 3.5)
    • Android Studio at /opt/android-studio
    • Flutter plugin version 42.1.1
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] Connected device (1 available)
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)

• No issues found!
```