HeroAnimation class

The HeroAnimation class creates the source and destination
PhotoHeroes, and sets up the transition.

Here’s the code:

timeDilation = 5.0; // 1.0 means normal animation speed.

    return Scaffold(
      appBar: AppBar(
        title: const Text('Basic Hero Animation'),
      ),
      body: Center(

child: PhotoHero(
          photo: 'images/flippers-alpha.png',
          width: 300.0,

onTap: () {

Navigator.of(context).push(MaterialPageRoute<void>(